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

Grid ClientDataSource and Grouping problem

3 Answers 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefania
Top achievements
Rank 2
Stefania asked on 09 Jul 2014, 07:27 AM
Hi
I was trying to replicate this demo
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/grouping/grouping-client-side-api/defaultcs.aspx
but I have some problem

As you can see from the attached it seems to work but Company and Cdc doesn't group for anything

If I try to add or delete group nothing happens
If I try to order by Company or Cdc (click on the arrow on the group) I have a js telerik error
TypeError: f.get_owner(...) is null

Grid
<telerik:RadGrid ID="HomeRadGrid" runat="server" ClientDataSourceID="RadClientDataSource1"
                EnableEmbeddedSkins="False" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
                Skin="MySkin" ShowGroupPanel="True" PageSize="10">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <MasterTableView AutoGenerateColumns="False" ClientDataKeyNames="Id, Bt1Attribute.Latitude, Bt1Attribute.Longitude, BaloonIcon"
                    HierarchyLoadMode="Client" GroupLoadMode="Client"  EnableGroupsExpandAll="true">                   
                    <GroupByExpressions>                   
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="CompanyDescription" FieldAlias="Company">
                                </telerik:GridGroupByField>
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="CompanyDescription">
                                </telerik:GridGroupByField>
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldName="CdcCode" FieldAlias="Cdc">
                                </telerik:GridGroupByField>
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="CdcCode" >
                                </telerik:GridGroupByField>
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
<Columns>
  <telerik:GridBoundColumn DataField="CompanyDescription" HeaderText="Company" SortExpression="CompanyDescription"
                        GroupByExpression="CompanyDescription GROUP BY CompanyDescription"
                            ShowFilterIcon="false" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains"
                            UniqueName="CompanyDescription" Visible="true" meta:resourcekey="GridBoundColumnResource1">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CdcCode" HeaderText="Project" SortExpression="CdcCode"
                            ShowFilterIcon="false" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains"
                            GroupByExpression="CdcCode GROUP BY CdcCode"
                            UniqueName="CdcCode" Visible="true" meta:resourcekey="GridBoundColumnResource2">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Cdc.Site" HeaderText="Site" SortExpression="Cdc.Site"
                            AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                            ItemStyle-Width="50px" FilterControlWidth="30px" UniqueName="Cdc.Site" Visible="true"
                            meta:resourcekey="GridBoundColumnResource3">
                            <ItemStyle Width="50px"></ItemStyle>
                        </telerik:GridBoundColumn>
....
 
 </Columns>
                    <PagerStyle AlwaysVisible="True" ShowPagerText="False" PageSizeControlType="None">
                    </PagerStyle>
                </MasterTableView>
                <ClientSettings ReorderColumnsOnClient="false" AllowDragToGroup="True" AllowColumnsReorder="false">
                    <ClientEvents OnRowDblClick="RowDblClick" OnHierarchyExpanded="LoadSmallMap" OnHierarchyExpanding="CollapseOtherRows" >
                    </ClientEvents>                   
                    <Selecting AllowRowSelect="true"></Selecting>
                    <Resizing AllowRowResize="false" AllowColumnResize="false" EnableRealTimeResize="false"
                        ResizeGridOnColumnResize="False"></Resizing>
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="True" CaseSensitive="false"></GroupingSettings>
            </telerik:RadGrid>

ClientDataSource
<telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="true">   
        <ClientEvents OnChange="LoadBigMap" OnDataParse="Parse" />
        <DataSource>
            <WebServiceDataSourceSettings>
                <Select Url="load_map.asmx/GetHomeData" RequestType="Post" DataType="JSON" ContentType="application/json; charset=utf-8" />
            </WebServiceDataSourceSettings>
        </DataSource>    
        <Schema>
            <Model>
                <telerik:ClientDataSourceModelField FieldName="F1204Status" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Id" DataType="Number" />
                <telerik:ClientDataSourceModelField FieldName="Ambiente" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="AmbienteFullName" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="CompanyDescription" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Cdc.CompanyCode" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Cdc.Code" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="CdcCode" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Cdc.Site" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Asset.Asset.Code" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Asset.Code" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Asset.Asset.Description" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Asset.Bt1" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Asset.Bt2" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="TxRxImg" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="GpsFixImg" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Attribute.Latitude" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Bt1Attribute.Longitude" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="BaloonIcon" DataType="String" />
            </Model>
        </Schema>     
    </telerik:RadClientDataSource>

function Parse (sender, args) {
               var data = args.get_response().d;
            
               args.set_parsedData(data);
           }

3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 14 Jul 2014, 05:20 AM
Hello Stefania,

The problem in the illustrated setup is that the grid is bound to a RadClientDataSource. With the current implementation of the control grouping is not supported when client-side data-binding is used. If using the grouping mechanism of the grid is mandatory for your project I recommend binding the control on the server.

Additionally please note that we are currently improving the grouping capabilities of the grid to support client-side data-binding. I sincerely hope that the functionality will be available in the next official release.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Stefania
Top achievements
Rank 2
answered on 14 Jul 2014, 12:42 PM
Hi Angel,
thanks for your reply.
I'm looking for some work around.
Is there any way to specify a groupbyexpression on client-side?

Thanks
0
Accepted
Angel Petrov
Telerik team
answered on 17 Jul 2014, 07:50 AM
Hi Stefania,

I am sorry to say but setting the group by expression on the client-side is not supported with the current version. For now the grouping can be performed only when server-side binding is used, respectively the group expressions can be set only on the server.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Stefania
Top achievements
Rank 2
Answers by
Angel Petrov
Telerik team
Stefania
Top achievements
Rank 2
Share this question
or