Grouping with OData? Will it work?

4 posts, 0 answers
  1. Carling
    Carling avatar
    15 posts
    Member since:
    May 2011

    Posted 06 Apr 2012 Link to this post

    I've been trying all day to get grouping to work in my Grid with OData.  Are there any known issues? Shouldn't it work?

    Here's some sample code that I know is not working:

    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server"></telerik:RadAjaxManagerProxy>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1">
        </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGridTicketDetails">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGridTicketDetails"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGridTicketDetails" runat="server" ActiveItemStyle-BackColor="Green" HeaderStyle-BackColor="#00597A" EnableEmbeddedSkins="true" Skin="Metro"
                     ShowGroupPanel="True" GroupingEnabled="true">
        <MasterTableView TableLayout="Fixed" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" GroupsDefaultExpanded="true" PageSize="10" GroupLoadMode="Client"
        AutoGenerateColumns="false">
        <PagerStyle CssClass="RadGridPager" Mode="NumericPages"></PagerStyle>
        <HeaderStyle CssClass="RadGridHeader"></HeaderStyle>
        <FooterStyle CssClass="FooterStyle"></FooterStyle>
        <Columns>
               <telerik:GridBoundColumn DataField="ProductID" HeaderText="ProductID" DataType="System.Int32">
                 </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="ProductName" HeaderText="ProductName" DataType="System.String">
                </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="UnitPrice" HeaderText="UnitPrice" DataType="System.Decimal" DataFormatString="{0:C}">
                 </telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="ReorderLevel" HeaderText="ReorderLevel" DataType="System.Int32">
                  </telerik:GridBoundColumn>
                  <telerik:GridCheckBoxColumn DataField="Discontinued" HeaderText="Discontinued" DataType="System.Boolean">
                  </telerik:GridCheckBoxColumn>
             </Columns>
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false" AllowDragToGroup="True" AllowGroupExpandCollapse="True" AllowColumnsReorder="true">
            <DataBinding Location="http://services.odata.org/Northwind/Northwind.svc" ResponseType="JSONP">
                <DataService TableName="Products" Type="OData"/>
            </DataBinding>
            <Selecting AllowRowSelect="True"/>
        </ClientSettings>
        <GroupingSettings ShowUnGroupButton="true"/>
    </telerik:RadGrid>
  2. Carling
    Carling avatar
    15 posts
    Member since:
    May 2011

    Posted 09 Apr 2012 Link to this post

    Has no one attempted this?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 11 Apr 2012 Link to this post

    Hello Carling,

    Unfortunately the RadGrid does not support grouping when it is bound on the client side. In order to have grouping enabled into the RadGrid you need to use server side data binding. Additionally on the following link you could find more information about client side data-binding limitations:
    http://www.telerik.com/help/aspnet-ajax/grid-client-side-binding-specifics.html (Client side data-binding limitations section).

    Kind regards,
    Radoslav
    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.
  5. Carling
    Carling avatar
    15 posts
    Member since:
    May 2011

    Posted 11 Apr 2012 Link to this post

    Thanks!  I had resorted to adding the groupings programmatically which was seeming to be working, but we'll just go to server-side binding.  That's sad, because the odata stuff is really cool.
Back to Top