This is a migrated thread and some comments may be shown as answers.

Grid with Grouping and Paging only shows first page

4 Answers 175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bradhh
Top achievements
Rank 2
bradhh asked on 16 Nov 2012, 11:08 PM
This was working in previous versions of the RadControls for ASP.NET AJAX, but now with version 2012.3.1016.35 it does not. I have a grid with both grouping and paging enabled, and only the first page appears. If I remove the <telerik:GridGroupByExpression> tag from the grid then the other pages are accessible.

Am I doing something wrong or is this a bug in the otherwise excellent Telerik controls?

Thanks -
Brad Harris

Here is my markup:

<html>
  <head>
    <title>Grid Group & Page Test</title>
  </head>
  <body>
    <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server" />
      <telerik:RadGrid
        ID="RgDamageCases"
        runat="server"
        AllowAutomaticDeletes="false"
        AllowAutomaticInserts="false"
        AllowAutomaticUpdates="false"
        AllowFilteringByColumn="true"
        AllowMultiRowEdit="false"
        AllowPaging="true"
        AllowSorting="false"
        AutoGenerateColumns="false"
        GridLines="Horizontal"
        PageSize="5"
        OnNeedDataSource="RgDamageCases_NeedDataSource"
        >
        <MasterTableView DataKeyNames="Id" CommandItemDisplay="None">
          <GroupByExpressions>
            <telerik:GridGroupByExpression>
              <SelectFields>
                <telerik:GridGroupByField FieldAlias="State" FieldName="State" HeaderValueSeparator=": " />
              </SelectFields>
              <GroupByFields>
                <telerik:GridGroupByField FieldName="State" SortOrder="Ascending" />
              </GroupByFields>
            </telerik:GridGroupByExpression>
          </GroupByExpressions>
          <Columns>
            <telerik:GridBoundColumn UniqueName="State" DataField="State" HeaderText="State" AllowFiltering="true"  AllowSorting="true" DataType="System.String" Visible="true" />
            <telerik:GridBoundColumn UniqueName="Name"  DataField="Name"  HeaderText="Name"  AllowFiltering="false" AllowSorting="true" DataType="System.String" Visible="true" />
          </Columns>
          <PagerStyle AlwaysVisible="true" Position="TopAndBottom" Mode="NextPrevAndNumeric" Visible="true" />
        </MasterTableView>
        <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" />
      </telerik:RadGrid>
    </form>
  </body>
</html>

And the codebehind:

Imports System.Collections.ObjectModel
Imports Telerik.Web.UI
 
 
Partial Class GridTest01Page
    Inherits System.Web.UI.Page
 
 
  Protected Sub RgDamageCases_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)
 
    Dim grid  As RadGrid = CType(source, RadGrid)
    Dim items As New Collection ( Of MyType )
 
    items.Add ( New MyType (  1, "001 Test", "AZ" ) )
    items.Add ( New MyType (  2, "002 Test", "AZ" ) )
    items.Add ( New MyType (  3, "003 Test", "AZ" ) )
    items.Add ( New MyType (  4, "004 Test", "AZ" ) )
    items.Add ( New MyType (  5, "005 Test", "AZ" ) )
    items.Add ( New MyType (  6, "006 Test", "AZ" ) )
    items.Add ( New MyType (  7, "007 Test", "AZ" ) )
    items.Add ( New MyType (  8, "008 Test", "AZ" ) )
    items.Add ( New MyType (  9, "009 Test", "AZ" ) )
    items.Add ( New MyType ( 10, "010 Test", "AZ" ) )
    items.Add ( New MyType ( 11, "011 Test", "AZ" ) )
 
    grid.DataSource = items
  End Sub
 
 
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    ' Nothing Here
  End Sub
 
 
End Class
 
 
Public Class MyType
 
  Private _Id    As Integer
  Private _Name  As String
  Private _State As String
 
  Public Property Id As Integer
    Get
      Return _Id
    End Get
    Set(value As Integer)
      _Id = value
    End Set
  End Property
 
  Public Property Name As String
    Get
      Return _Name
    End Get
    Set(value As String)
      _Name = value
    End Set
  End Property
 
  Public Property State As String
    Get
      Return _State
    End Get
    Set(value As String)
      _State = value
    End Set
  End Property
 
  Public Sub New(ByVal id As Integer, ByVal name As String, ByVal state As String)
    Me.Id    = id
    Me.Name  = name
    Me.State = state
  End Sub
 
End Class

4 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 19 Nov 2012, 12:27 PM
Hello,

We are aware of this issue and our developers will give their best to ensure a proper fix for it in our next official release Q3 2012 SP1, which will be released at the beginning of December. Meantime, you can set EnableLinqGrouping property to false as a possible workaround.

Greetings,
Milena
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ted
Top achievements
Rank 1
Iron
Iron
answered on 19 Nov 2012, 10:17 PM
I'm seeing the same issue and EnableLinqGrouping is not working.  Only one page of data is shown in the pager when there should be many when using grouping.
0
bradhh
Top achievements
Rank 2
answered on 19 Nov 2012, 10:33 PM
After trying several things, I've found that adding the EnableLinqGrouping="false" attribute to the <MasterTableView> tag solved my problem:

I hope that helps.

<MasterTableView DataKeyNames="Id" CommandItemDisplay="None" EnableLinqGrouping="false">
   ...
</MasterTableView>
0
michelle
Top achievements
Rank 1
answered on 22 May 2014, 12:41 PM
So the EnableLinqGrouping="false"  did not work for me, but what did work was adding a selectfield

<GroupByExpressions>
                    <telerik:GridGroupByExpression>
                         <SelectFields>
                            <telerik:GridGroupByField FieldAlias="AccountId" FieldName="AccountId" />
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="AccountId" SortOrder="Descending"  />
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
Tags
Grid
Asked by
bradhh
Top achievements
Rank 2
Answers by
Milena
Telerik team
Ted
Top achievements
Rank 1
Iron
Iron
bradhh
Top achievements
Rank 2
michelle
Top achievements
Rank 1
Share this question
or