or
Rewrote the queries to load the grids...
Dim tblTable As DataTable = DirectCast(ViewState("dtTblData"), DataTable) ''some codes ...ViewState("dtTblData") = tblTablergInvoiceList.DataSource = tblTableTry Dim expression1 As GridGroupByExpression = GridGroupByExpression.Parse("ClaimsFor [Claims Type], count(ClaimsFor) Items [My Items], Sum(Total) [Group Total] Group By ClaimsFor") Me.CustomizeExpression(expression1) Me.rgInvoiceList.MasterTableView.GroupByExpressions.Add(expression1) rgInvoiceList.Rebind()Catch ex As Exception Console.WriteLine("error" & ex.Message)FinallyEnd Try<telerik:RadGrid ID="rgInvoiceList" runat="server" CellSpacing="0" GridLines="None" ShowFooter="True" Skin="Hay" AllowSorting="True"> <ClientSettings EnablePostBackOnRowClick="True"> <Selecting CellSelectionMode="None" AllowRowSelect="True"></Selecting> </ClientSettings> <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID" AllowCustomSorting="true"> <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn> </EditFormSettings> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldName="Total"/> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="ClaimsFor" SortOrder="Descending"/> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> </MasterTableView> <FilterMenu EnableImageSprites="False"></FilterMenu></telerik:RadGrid><telerik:RadGrid ID="HomeRadGrid" runat="server" OnNeedDataSource="HomeRadGrid_NeedDataSource" EnableEmbeddedSkins="False" AllowPaging="True" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AllowSorting="True" AllowFilteringByColumn="True" CellSpacing="0" Culture="it-IT" GridLines="None" OnItemCommand = "HomeRadGrid_ItemCommand" OnGroupsChanging="HomeRadGrid_GroupsChanging" OnItemDataBound = "HomeRadGrid_ItemDataBound" Skin="MySkin" ShowGroupPanel="True"> <PagerStyle Mode="NextPrevAndNumeric" /> <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" DataKeyNames="Id"> <ColumnGroups> <telerik:GridColumnGroup Name="GeneralInformation" HeaderText="General Information" HeaderStyle-HorizontalAlign="Center" /> <telerik:GridColumnGroup Name="WarningsIcon" HeaderText="Warnings" HeaderStyle-HorizontalAlign="Center" /> </ColumnGroups> <CommandItemSettings RefreshText="" ShowAddNewRecordButton="false" /> <GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="Company" FieldName="Cdc.CompanyCode"></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="Cdc.CompanyCode" SortOrder="Descending"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldAlias="Project" FieldName="Cdc.Code" ></telerik:GridGroupByField> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="Cdc.Code"></telerik:GridGroupByField> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions> <Columns> <telerik:GridBoundColumn DataField="Cdc.CompanyCode" HeaderText="Company Code" SortExpression="Cdc.CompanyCode" UniqueName="Cdc.CompanyCode" Visible="false" ColumnGroupName="GeneralInformation" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Cdc.Code" HeaderText="Project" SortExpression="Cdc.Code" UniqueName="Cdc.Code" Visible="false" ColumnGroupName="GeneralInformation" > </telerik:GridBoundColumn> <telerik:GridHyperLinkColumn DataNavigateUrlFields="Bt1Asset.Asset.Code,Cdc.CompanyCode, Bt1Asset.Code, Ambiente" DataNavigateUrlFormatString="Default.aspx?id={0}&filtro_soc2={1}&cgrcod={2}&amb_anag={3}&site=*&commessa=*&codicemezzo=*" DataTextField="Bt1Asset.Asset.Code" UniqueName="Bt1Asset.Asset.Code" HeaderText="Asset Code" HeaderStyle-Width="150px" ColumnGroupName="GeneralInformation" ></telerik:GridHyperLinkColumn> <telerik:GridBoundColumn DataField="Bt1Asset.Asset.Description" HeaderText="Asset Description" SortExpression="Bt1Asset.Asset.Description" UniqueName="Bt1Asset.Asset.Description" Visible="true" ColumnGroupName="GeneralInformation" > </telerik:GridBoundColumn> <telerik:GridImageColumn HeaderText="BT1" AllowFiltering="false" HeaderStyle-Width="50px" ItemStyle-Width="50px" ColumnGroupName="WarningsIcon" UniqueName="Bt1Asset.Bt1"> </telerik:GridImageColumn> <telerik:GridImageColumn HeaderText="BT2" AllowFiltering="false" UniqueName="Bt1Asset.Bt2" HeaderStyle-Width="50px" ItemStyle-Width="50px" ColumnGroupName="WarningsIcon"> </telerik:GridImageColumn> <telerik:GridImageColumn HeaderText="Tx/Rx" AllowFiltering="false" HeaderStyle-Width="50px" ItemStyle-Width="50px" ColumnGroupName="WarningsIcon"> </telerik:GridImageColumn> <telerik:GridImageColumn HeaderText="Alerts" AllowFiltering="false" HeaderStyle-Width="50px" ItemStyle-Width="50px" ColumnGroupName="WarningsIcon"> </telerik:GridImageColumn> </Columns> <NestedViewTemplate> <div class="carBackground"> <div style="float: left; padding-left: 40px; padding-right:20px; padding-top:10px"> <asp:Image ID="ItemImage" runat="server" AlternateText="" ImageUrl='<%# GetItemImageUrl(Container)%>' Width="200px" /> </div> <div style="float: left; width: 50%"> <div class="carTitle"> <%# Eval("Bt1Asset.Asset.Code")%> </div> <span style="color: #555555"> <%# Eval("Bt1Asset.Asset.Description")%> times</span> <hr class="lineSeparator" /> <table width="100%" class="carInfo"> <tr> <td> <strong>Site:</strong> <%# Eval("Cdc.Site")%> </td> </tr> <tr> <td> <strong>Plate:</strong> <%# Eval("Bt1Asset.Asset.Targa")%> </td> </tr> </table> </div> <div style="float: right; padding-right: 40px; padding-left:20px;padding-top:10px"> <div style="width:200px; border:solid 1px black" id="small_map_div"></div> </div> <div style="clear: both"> </div> </div> </NestedViewTemplate> </MasterTableView> <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True"> <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents> <Selecting AllowRowSelect="False"></Selecting> <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing> </ClientSettings> <GroupingSettings ShowUnGroupButton="true"></GroupingSettings> </telerik:RadGrid> function RowDblClick(sender, args) { //expand/collapse nested row
}//Set tool tip if (e.Item is GridDataItem) { GridDataItem gridItem = e.Item as GridDataItem; foreach (GridColumn column in RadGrid_PurchaseOrderDetail.MasterTableView.RenderColumns) { if (column is GridBoundColumn) { gridItem["PartItems"].ToolTip = gridItem["SKUNumber"].Text; gridItem["Price"].ToolTip = gridItem["StandardCost"].Text; } } } gridItem["SKUNumber"].Text this is ' '