Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
Paging in SharePoint doesn't work
posted

I created a web part using the 2008 volume 2 datagrid.

Everything seems to work except for the paging.

When I enable paging, the appropriate number of page number hyper links appear, but clicking them doesn't update the grid. 

 

I can reproduce this using the Infragistics Sample AJAX Grid.  I also can reproduce this problem without AJAX.

Here's some code from web part:

   private Panel GetSearchResultPanel()
        {
            Panel panel = new Panel();
            searchHitCount = new LiteralControl();
            panel.Controls.Add(searchHitCount);
            panel.Style.Add("padding", "5px");
            panel.Width = 620;
      
            searchResults = new UltraWebGrid();
            searchResults.ID = Guid.NewGuid().ToString();
          

          
            searchResults = new UltraWebGrid();
            searchResults.Height = 400;
            searchResults.Width = 600;
            searchResults.ID = "infragisticsWebDataGrid";
            searchResults.DataKeyField = "ClientNumber,MatterNumber";

            searchResults.DisplayLayout.AllowColSizingDefault = AllowSizing.Free;
            searchResults.DisplayLayout.AllowDeleteDefault = AllowDelete.No;
            searchResults.DisplayLayout.AllowSortingDefault = AllowSorting.No;
            searchResults.DisplayLayout.AllowColumnMovingDefault = AllowColumnMoving.None;
    

            searchResults.DisplayLayout.AllowUpdateDefault = AllowUpdate.No;
            searchResults.DisplayLayout.BorderCollapseDefault = BorderCollapse.Separate;
            searchResults.DisplayLayout.HeaderClickActionDefault = HeaderClickAction.NotSet;
        

            searchResults.DisplayLayout.RowHeightDefault = 20;
            searchResults.DisplayLayout.RowSelectorsDefault = RowSelectors.No;
            searchResults.DisplayLayout.ViewType = Infragistics.WebUI.UltraWebGrid.ViewType.Flat;
            searchResults.DisplayLayout.SelectTypeRowDefault = SelectType.None;
            searchResults.DisplayLayout.StationaryMargins = StationaryMargins.Header;
            searchResults.DisplayLayout.StationaryMarginsOutlookGroupBy = true;

            searchResults.DisplayLayout.FrameStyle.BackColor = Color.White;
            searchResults.DisplayLayout.FrameStyle.BorderColor = Color.Gray;
            searchResults.DisplayLayout.FrameStyle.BorderStyle = BorderStyle.Solid;
            searchResults.DisplayLayout.FrameStyle.BorderWidth = 1;
            searchResults.DisplayLayout.FrameStyle.Font.Name = "Microsoft Sans Serif";
            searchResults.DisplayLayout.FrameStyle.Font.Size = 8;
            searchResults.DisplayLayout.FrameStyle.Height = 300;
            searchResults.DisplayLayout.FrameStyle.Width = 660;

            searchResults.DisplayLayout.Pager.MinimumPagesForDisplay = 2;
            searchResults.DisplayLayout.Pager.AllowPaging = allowPaging;
            searchResults.DisplayLayout.Pager.PageSize = pageSize;

            searchResults.DisplayLayout.Pager.PagerStyle.BackColor = Color.LightGray;
            searchResults.DisplayLayout.Pager.PagerStyle.BorderStyle = BorderStyle.Solid;
            searchResults.DisplayLayout.Pager.PagerStyle.BorderWidth = 1;
            searchResults.DisplayLayout.Pager.PagerStyle.BorderDetails.ColorLeft = Color.White;
            searchResults.DisplayLayout.Pager.PagerStyle.BorderDetails.ColorTop = Color.White;
            searchResults.DisplayLayout.Pager.PagerStyle.BorderDetails.WidthLeft = 1;
            searchResults.DisplayLayout.Pager.PagerStyle.BorderDetails.WidthTop = 1;

            searchResults.DisplayLayout.HeaderStyleDefault.BackColor = Color.LightGray;
            searchResults.DisplayLayout.HeaderStyleDefault.BorderStyle = BorderStyle.Solid;
            searchResults.DisplayLayout.HeaderStyleDefault.BorderWidth = 1;
            searchResults.DisplayLayout.HeaderStyleDefault.ForeColor = Color.Black;


            searchResults.DisplayLayout.HeaderStyleDefault.BorderDetails.ColorLeft = Color.White;
            searchResults.DisplayLayout.HeaderStyleDefault.BorderDetails.ColorTop = Color.White;
            searchResults.DisplayLayout.HeaderStyleDefault.BorderDetails.WidthLeft = 1;
            searchResults.DisplayLayout.HeaderStyleDefault.BorderDetails.WidthTop = 1;

            searchResults.DisplayLayout.RowStyleDefault.BackColor = Color.White;
            searchResults.DisplayLayout.RowStyleDefault.BorderColor = Color.Silver;
            searchResults.DisplayLayout.RowStyleDefault.BorderStyle = BorderStyle.Solid;
            searchResults.DisplayLayout.RowStyleDefault.BorderWidth = 1;
            searchResults.DisplayLayout.RowStyleDefault.Font.Name = "Microsoft Sans Serif";
            searchResults.DisplayLayout.RowStyleDefault.Font.Size = 8;
            searchResults.DisplayLayout.RowStyleDefault.Padding.Left = 3;
            searchResults.DisplayLayout.RowStyleDefault.BorderDetails.ColorTop = Color.White;
            searchResults.DisplayLayout.RowStyleDefault.BorderDetails.ColorLeft = Color.White;
            searchResults.DisplayLayout.RowAlternateStyleDefault.BackColor = Color.AliceBlue;


            searchResults.DisplayLayout.GroupByRowStyleDefault.BackColor = Color.White;
            searchResults.DisplayLayout.GroupByRowStyleDefault.BorderColor = Color.Gray;

            searchResults.DisplayLayout.GroupByBox.BoxStyle.BackColor = Color.WhiteSmoke;

            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.BackColor = Color.White;
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.BorderColor = Color.Silver;
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.BorderStyle = BorderStyle.Solid;
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.BorderWidth = 1;
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.CustomRules = "overflow:auto;";
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.Font.Name = "Verdana,Arial,Helvetica,sans-serif";
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.Font.Size = 11;
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.Height = 300;
            searchResults.DisplayLayout.FilterOptionsDefault.FilterDropDownStyle.Width = 200;

            searchResults.DisplayLayout.NoDataMessage = " No data to display...";

        
         
           
            panel.Controls.Add(searchResults);

            return panel;

        }

 

 

 

  • 28464
    posted

    Hello,

    It is a bit hard for us to debug that easily in public forum -- I do have some suggestions that might help though.

    1) Where are you using the GetSearchResultPanel() method -- in which event of the page lifecycle? I think for dynamically creating controls this would either have to be OnInit or CreateChildControls.

    2) I remember having some issues in our UltraWebGrid with Sharepoint (when the grid was used as a WebPart) that were later fixed in a hotfix - so make sure you have the latest hotfix applied

    3) Please, go through the following forum posts:

    SharePoint webpart with WebGrid inside 

    http://forums.infragistics.com/forums/p/14123/52607.aspx#52607

    and especially through the following blog post:

    Getting SharePoint and ASP.NET AJAX and UltraWebGrid to Work Together

    http://blogs.infragistics.com/blogs/tsnyder/archive/2008/07/29/getting-sharepoint-and-ms-ajax-to-work-together-is-lots-of-fun.aspx

    There are a lot of insights and sample code on how to use our controls inside of Sharepoint.

    Hope this help.