Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have got a list with 360 000 elements. I must add pagging on it because if I put only 96 000 elements to the Calendar the site with this webpart load me about 5 minutes. The module works like that I first choose a worker from drop down list, and then i show a working days on ASP Calendar: enter image description here

How Can I add a pagging by the worker. I have got that CAML Query, and its adding a elements:

   string FullQuery = "<Where><And><Eq><FieldRef Name='{0}' /><Value Type='DateTime'>{1}</Value></Eq><Eq><FieldRef Name='Pracownik' /><Value Type='Text'>{2}</Value></Eq></And></Where>";
        string dateISO = SPUtility.CreateISO8601DateTimeFromSystemDateTime(e.Day.Date.ToLocalTime());

        SPWeb witryna = SPContext.Current.Web;
        var query1 = new SPQuery();
        if (DropDownList1.SelectedItem.Text == "<-- Wszystcy pracownicy -->" || DropDownList1.SelectedItem.Text == "")
        {
            query1.Query = String.Format(DateOnlyQuery, "Dzien", dateISO);
            query1.ViewFields = "<FieldRef Name='Kontrakt' /><FieldRef Name='Procent' />";
            query1.ViewFieldsOnly = true;

            SPListItemCollection listaDniPrzeznaczonychNaProjekt = witryna.Lists["Szczegoly"].GetItems(query1);


            // Gdy nie ma zaznaczonej osoby to wtedy wyświetlamy wszystkie daty urlopów 
            foreach (SPListItem olistaDniPrzeznaczonychNaProjekt in listaDniPrzeznaczonychNaProjekt)
            {
                e.Cell.Style.Add("background-color", "#0099FF");
                e.Cell.CssClass = "dni_swiateczne";
                //   e.Cell.Controls.Add(new LiteralControl(("<p style='color:blue; font-size:8px;'>" + olistaDniPrzeznaczonychNaProjekt["Kontrakt"].ToString() + "</p><p style='color:#5D198E;'>" + olistaDniPrzeznaczonychNaProjekt["Procenty"].ToString().Substring(3) + "</p>")));
            }

        }
        // w przeciwnym wypadku gdy jest wybrama i zaznaczona osoba, wtedy to wyświetlamy daty urlopów dla poszczególnej osoby
        else
        {
            query1.Query = String.Format(FullQuery, "Dzien", dateISO, DropDownList1.SelectedItem.Text);
            query1.ViewFields = "<FieldRef Name='Kontrakt' /><FieldRef Name='Procent' />";
            query1.ViewFieldsOnly = true;

            SPListItemCollection listaDniPrzeznaczonychNaProjekt = witryna.Lists["Szczegoly"].GetItems(query1);
share|improve this question
1  
is it sharepoint 2013 –  Muhammad Raja Nov 25 '12 at 18:55
    
No it is Sharepoint 2010 and ASP Calendar. –  Grzegorz Z Nov 25 '12 at 23:11
    
Run it up in google chrome and trace the JavaScript see if you get the same error, if you do you can trace it accurately in there. –  Hugh Wood Nov 26 '12 at 9:44
    
I can manage This Error :) I get a Screen from another question, but when I adding a lot's of element's it's slows, and slows a lot :( Please help to add paging to the ASP Calendar. –  Grzegorz Z Nov 26 '12 at 13:46
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.