<%@ Page Language="C#" AutoEventWireup="true" CodeFile="quotpart_BOM.aspx.cs" Inherits="quotpart_BOM" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Part Bill of material</title> <style type="text/css"> #GridQuotationsPanel { height: 100%; } </style><head></head> <script language="javascript" src="../../JavaScript/PopUps.js" type="text/javascript"></script> </script></head><body> <script language="javascript" type="text/javascript"> function Refresh() { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); } function RefreshAll() { $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("All"); } </script> <form id="form1" runat="server"> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"> </telerik:RadStyleSheetManager> <div> <telerik:RadScriptManager ID="radScriptManager" runat="server"> </telerik:RadScriptManager> <telerik:RadAjaxManager ID="RadAjaxManager1" EnableOutsideScripts="True" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> <UpdatedControls> <telerik:AjaxUpdatedControl LoadingPanelID="loading" ControlID="GridQuotations" /> <telerik:AjaxUpdatedControl ControlID="txtSearchCode" /> <telerik:AjaxUpdatedControl ControlID="txtCode" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnSearch"> <UpdatedControls> <telerik:AjaxUpdatedControl LoadingPanelID="loading" ControlID="GridQuotations" /> <telerik:AjaxUpdatedControl ControlID="txtSearchCode" /> <telerik:AjaxUpdatedControl ControlID="txtCode" /> </UpdatedControls> </telerik:AjaxSetting> <telerik:AjaxSetting AjaxControlID="btnAdd"> <UpdatedControls> <telerik:AjaxUpdatedControl LoadingPanelID="loading" ControlID="GridQuotations" /> <telerik:AjaxUpdatedControl ControlID="txtSearchCode" /> <telerik:AjaxUpdatedControl ControlID="txtCode" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="loading" HorizontalAlign="Center" MinDisplayTime="500" Transparency="30" runat="server"> <div id="divLoader" class="loading"> </div> </telerik:RadAjaxLoadingPanel> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left" colspan="3"> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"> <tr> <td valign="top" class="main-header" height="80"> <table width="100%" border="0px" cellspacing="0" cellpadding="0"> <tr> <td> <table width="100%" border="0px" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td class="library_logo" valign="middle"> Library <asp:HiddenField ID="hdnCustomerId" runat="server" Value="0" /> <asp:HiddenField ID="hdnQuotId" runat="server" Value="0" /> </td> </tr> </table> </td> <td valign="top"> </td> </tr> </table> </td> </tr> <tr> <td class="pop_up_sub_header" valign="middle"> <table border="0" cellspacing="0" cellpadding="0" width="100%" height="27px"> <tr> <td width="95%" class="Pdding_left"> <asp:Label ID="lblPath" runat="server"></asp:Label> </td> <td> <a href="#" onclick="javascript:self.close();" class="close_btn">Close</a> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td class="popup-inner-heading2"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left" width="31%"> <asp:Button ID="btnAdd" runat="server" Text="Save" class="save" OnClick="btnAdd_Click" /> </td> </tr> </table> </td> </tr> <tr> <td class="popup-inner-heading2"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td align="left" width="5%"> <span><b>Type</b></span> </td> <td align="left" width="15%"> <asp:DropDownList ID="ddlmode" runat="server" Width="90%"> <asp:ListItem Value="Comp">Component</asp:ListItem> <asp:ListItem Value="Part">Parts</asp:ListItem> <asp:ListItem Value="Prod">Product</asp:ListItem> <asp:ListItem Value="Bought">Bought</asp:ListItem> </asp:DropDownList> </td> <td align="left" valign="middle" width="5%"> <asp:Button ID="btnGo" runat="server" Text="Go" class="go_button" OnClick="btnGo_Click" /> </td> <td align="left" width="5%"> <span><b>Code</b></span> </td> <td align="left" width="15%"> <asp:TextBox ID="txtCode" runat="server" Width="95%"></asp:TextBox> </td> <td align="left" valign="middle" width="5%"> <asp:ImageButton ID="btnSearch" runat="server" ImageUrl="../../App_Themes/GPC/images/search_search_btn.jpg" CausesValidation="false" OnClick="btnSearch_Click" /> </td> <td align="left" width="15%" valign="middle"> <a href="" onclick="return Overlay();"> <asp:Button ID="Button2" runat="server" CssClass="search_header" UseSubmitBehavior="false"> </asp:Button> Advanced Search</a> </td> <td align="left" width="10%"> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td valign="top" height="100%"> <div class="search_win" id='searchgrid' runat="server"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td rowspan="5" class="search_slider"> </td> <td width="17" height="25" bgcolor="#DBDBDB"> </td> <td height="25"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="middle" bgcolor="#DBDBDB"> <img src="../../App_Themes/GPC/images/search_magi.jpg" width="21" height="25" /> </td> <td align="right" valign="middle" bgcolor="#DBDBDB" onclick="return Closesearch();"> <img src="../../App_Themes/GPC/images/search_close.jpg" onclick="return Closesearch();" width="14" height="13" /> </td> </tr> </table> </td> <td width="17" height="25" bgcolor="#DBDBDB"> </td> </tr> <tr> <td width="17" height="12"> </td> <td height="12"> </td> <td width="17" height="12"> </td> </tr> <tr> <td width="17"> </td> <td align="center" valign="top"> <asp:Panel ID="pnlSearch" runat="server" DefaultButton="Button1"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="1" align="right" valign="top"> <img src="../../App_Themes/GPC/images/search_in_left_top.jpg" width="3" height="4" border="0" style="display: block; padding: 0; margin: 0; font-size: 0px;" /> </td> <td height="4" align="left" valign="top" class="search_top_bor"> </td> <td width="1" align="right" valign="top"> <img src="../../App_Themes/GPC/images/search_in_right_top.jpg" width="3" height="4" border="0" style="display: block; padding: 0; margin: 0; font-size: 0px;" /> </td> </tr> <tr> <td width="1" class="search_left_bor"> </td> <td align="center" valign="top" bgcolor="#efefef"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="3"> <tr> <td height="5" align="left" valign="middle"> </td> </tr> <tr> <td align="left" valign="middle"> <span>Code</span> </td> </tr> <tr> <td align="left" valign="middle"> <asp:TextBox ID="txtSearchCode" runat="server" CssClass="newinput" Type="Number" Width="100%" MaxLength="10" NumberFormat-DecimalDigits="0" EnableEmbeddedSkins="false"> </asp:TextBox> </td> </tr> <tr> <td align="left" valign="middle"> <span>Description</span> </td> </tr> <tr> <td align="left" valign="middle"> <asp:TextBox ID="txtSearchDescription" runat="server" MaxLength="10" NumberFormat-DecimalDigits="0" CssClass="newinput" Type="Number" Width="100%" EnableEmbeddedSkins="false"> </asp:TextBox> </td> </tr> <tr> <td align="left" valign="middle"> <table border="0" align="center" cellpadding="0" cellspacing="3"> <tr> <td align="right"> <asp:Button ID="Button1" runat="server" Style="display: none;" Text="Button" OnClientClick="return false;" /> <img onclick="return Refresh();" alt="Search" src="../../App_Themes/GPC/images/search_search_btn.jpg"> </td> <td align="left"> <img onclick="return RefreshAll();" alt="View All" src="../../App_Themes/GPC/images/search_all_btn.jpg"> </td> </tr> </table> </td> </tr> <tr> <td> </td> </tr> </table> </td> <td width="1" class="search_right_bor"> </td> </tr> <tr> <td width="1"> <img src="../../App_Themes/GPC/images/search_in_left_bot.jpg" width="3" height="4" border="0" style="display: block; padding: 0; margin: 0; font-size: 0px;" /> </td> <td height="4" class="search_bot_bor"> </td> <td width="1"> <img src="../../App_Themes/GPC/images/search_in_right_bot.jpg" width="3" height="4" border="0" style="display: block; padding: 0; margin: 0; font-size: 0px;" /> </td> </tr> </table> </asp:Panel> </td> <td width="17"> </td> </tr> <tr> <td width="17"> </td> <td> </td> <td width="17"> </td> </tr> <tr> <td colspan="3"> </td> </tr> </table> </div> <div id='maingrid' style="height: 100%;"> <telerik:RadGrid ID="GridQuotations" Skin="RadSkin" runat="server" Height="100%" AllowPaging="True" PageSize="30" Width="100%" EnableEmbeddedSkins="False" AutoGenerateColumns="False" AllowSorting="True" GridLines="None" AllowMultiRowSelection="True" EnableOutsideScripts="True" OnNeedDataSource="GridQuotations_NeedDataSource"> <ExportSettings> <Pdf PageWidth="8.5in" PageHeight="11in" PageTopMargin="" PageBottomMargin="" PageLeftMargin="" PageRightMargin="" PageHeaderMargin="" PageFooterMargin=""></Pdf> </ExportSettings> <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true"></PagerStyle> <MasterTableView CommandItemDisplay="None" DataKeyNames="SearchID" AllowMultiColumnSorting="True" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" EditMode="InPlace"><EditFormSettings><EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" EditImageUrl="Edit.gif" CancelImageUrl="Cancel.gif"></EditColumn></EditFormSettings> <CommandItemStyle CssClass="top-icon-bar" /> <RowIndicatorColumn Visible="False"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn Resizable="False"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridClientSelectColumn UniqueName="Column"> <HeaderStyle Width="5%" /> </telerik:GridClientSelectColumn> <telerik:GridTemplateColumn HeaderText="Code" UniqueName="Code" DataField="Code"> <ItemTemplate> <asp:Label ID="lblCode" runat="server" Text='<%# Bind("Code") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="20%"></HeaderStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Quantity" UniqueName="Quantity" DataField="Quantity"> <ItemTemplate> <telerik:RadTextBox ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>' Width="50px"></telerik:RadTextBox> </ItemTemplate> <HeaderStyle Width="20%"></HeaderStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Description" UniqueName="description" DataField="description"> <ItemTemplate> <asp:Label ID="lblDescription" runat="server" Text='<%# Bind("description") %>'></asp:Label> </ItemTemplate> <HeaderStyle Width="25%"></HeaderStyle> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Cost(£)" UniqueName="cost"> <ItemTemplate> <%# Eval("cost")%> </ItemTemplate> <HeaderStyle Width="40%"></HeaderStyle> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" /> <Selecting AllowRowSelect="true" /> <ClientEvents /> </ClientSettings> <ValidationSettings CommandsToValidate="PerformInsert,Update" /> <ItemStyle HorizontalAlign="Left" Width="20%" /> <FilterMenu Skin="RadSkin" EnableEmbeddedSkins="False" EnableTheming="True"> <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> </FilterMenu> </telerik:RadGrid> </div> </td> </tr> <tr> <td valign="bottom" class="footer-bar"> </td> </tr> </table> </div> </form></body></html>using System;using System.Web;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Telerik.Web.UI;using library.searchs;using library.parts;using settings.Users;using library.Quotations;public partial class quotpart_BOM : BasePage{ protected void Page_Load(object sender, EventArgs e) { if ((Session["User"] != null) && ((((LoginUsers)Session["User"]).UserId > 0))) { if (!IsPostBack) { if (Request.QueryString["cid"] != null && Request.QueryString["id"] != null) { hdnCustomerId.Value = Request.QueryString["cid"].ToString(); hdnQuotId.Value = Request.QueryString["id"].ToString(); } } } else { Response.Redirect("~/control/message.aspx?s=1"); } } protected void GridQuotations_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { librarySearch objBLL = new librarySearch(Convert.ToInt64(hdnCustomerId.Value)); //objBLL.SearchType = "Prod"; objBLL.SearchType = ddlmode.SelectedValue; objBLL.Order = 2; objBLL.OrderBy = 1; objBLL.PageIndex = 1; objBLL.RecordperPage = 99999; if (txtCode.Text.Trim().Length > 0) { objBLL.Code = txtCode.Text; txtSearchCode.Text = txtCode.Text; } GridQuotations.DataSource = (objBLL.LibrarySearchGetAll(objBLL)).SearchResults; objBLL = null; } protected void btnGo_Click(object sender, EventArgs e) { GridQuotations.Rebind(); } protected void btnSearch_Click(object sender, ImageClickEventArgs e) { GridQuotations.Rebind(); } protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) { if (e.Argument == "Rebind") { txtCode.Text = txtSearchCode.Text; GridQuotations.MasterTableView.SortExpressions.Clear(); GridQuotations.MasterTableView.GroupByExpressions.Clear(); GridQuotations.Rebind(); } if (e.Argument == "All") { clearSearchTerms(); GridQuotations.MasterTableView.SortExpressions.Clear(); GridQuotations.MasterTableView.GroupByExpressions.Clear(); GridQuotations.Rebind(); } } private void clearSearchTerms() { txtSearchCode.Text = ""; txtSearchDescription.Text = ""; txtCode.Text = ""; } protected void btnAdd_Click(object sender, EventArgs e) { string product_ID_STR = ""; string product_Qty_STR = ""; string product_type_STR = ""; for (int i = 0; i < GridQuotations.Items.Count; i++) { if (((CheckBox)(GridQuotations.Items[i]["column"].Controls[0])).Checked) { product_ID_STR = product_ID_STR + GridQuotations.MasterTableView.DataKeyValues[i]["SearchID"].ToString() + ','; product_Qty_STR = product_Qty_STR + (GridQuotations.Items[i].FindControl("txtQuantity") as RadTextBox).Text + ','; product_type_STR = product_type_STR + (ddlmode.SelectedValue == "Prod" ? "Part" : ddlmode.SelectedValue) + ','; } } product_ID_STR = product_ID_STR.Trim(','); product_Qty_STR = product_Qty_STR.Trim(','); product_type_STR = product_type_STR.Trim(','); if (product_ID_STR.Trim().Length > 0) { QuotationBLL objQuotationBLL = new QuotationBLL(); Quotation objQuotation = new Quotation(); objQuotation.product_ID_STR = product_ID_STR; objQuotation.product_Qty_STR = product_Qty_STR; objQuotation.product_type_STR = product_type_STR; objQuotation.quot_pk = Convert.ToInt64(hdnQuotId.Value); objQuotation.updated_by = ((LoginUsers)Session["User"]).UserId; objQuotationBLL.fnAddQuotationProduct(objQuotation); objQuotationBLL = null; objQuotation = null; RadAjaxManager1.ResponseScripts.Add("returnToParent();"); } else { RadAjaxManager1.Alert("No record selected"); } }}I have a grid with nested views via tempates. The tamplate retrieves data though an ObjectDataSource that gets it form a Webservice.
Now, when I expand any element in the hierarchy it works perfectly, however, if I try to sort or filter any column from the Mater Table, I get an exception:
Error: Sys.WebForms.PageRequestManagerServerErrorException: The DataSourceID of 'FormView' must be the ID of a control of type IDataSource. A control with ID 'ObjectDataSource' could not be found.
I have tried adding the same ObjectDataSource after the grid definition but it does work (not exception thrown) for sorting/filtering of the Master Table but if I try to expand any of the nested views, it simply does not show any data. However, if right before I try sorting/filtering the master table (right after I load the gid for the first time) I expand any of the nested views, they do get the data. It is only after I sort/filter that they don't.
The following is the code for the radGrid that I currently have, which is the one that forces the exception to be thrown:
<telerik:RadGrid ID="OrbitRadGrid" runat="server" AllowFilteringByColumn="True" AllowSorting="True" VirtualItemCount="50000" GridLines="None" AllowPaging="true" PageSize="20" AllowCustomPaging="true" ShowGroupPanel="false" EnableLinqExpressions="false" OnNeedDataSource="OrbitRadGrid_NeedDataSource" OnSortCommand="OrbitRadGrid_SortCommand" Skin="WebBlue" > <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="False" ReorderColumnsOnClient="True"> <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True" SaveScrollPosition="True" /> <Resizing AllowColumnResize="True" /> </ClientSettings> <MasterTableView DataKeyNames="Item_Name, Source_Name" AutoGenerateColumns="False" AllowNaturalSort="false" > <Columns> <telerik:GridBoundColumn DataField="Item_Name" HeaderText="Item Name" ReadOnly="True" SortExpression="Item_Name" UniqueName="Item_Name" HeaderStyle-Width="220px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Source_Name" HeaderText="Item Source" ReadOnly="True" SortExpression="Source_Name" UniqueName="Source_Name" HeaderStyle-Width="220px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ItemType_Name" HeaderText="Item Type" ReadOnly="True" SortExpression="ItemType_Name" UniqueName="ItemType_Name" HeaderStyle-Width="115px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Team_Name" HeaderText="Item Team" ReadOnly="True" SortExpression="Team_Name" UniqueName="Team_Name" HeaderStyle-Width="115px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IsTestItem" HeaderText="Test" ReadOnly="True" UniqueName="IsTestItem" AllowFiltering="false" HeaderStyle-Width="50px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IsItemOnHold" HeaderText="On Hold" ReadOnly="True" UniqueName="IsItemOnHold" AllowFiltering="false" HeaderStyle-Width="62px"> </telerik:GridBoundColumn> </Columns> <NestedViewTemplate> <asp:Label ID="ItemName" Text='<%# Eval("Item_Name") %>' Visible="false" runat="server" /> <asp:Label ID="ItemSource" Text='<%# Eval("Source_Name") %>' Visible="false" runat="server" /> <asp:FormView ID="FormView" runat="server" DataSourceID="ObjectDataSource"> <ItemTemplate> <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap" Width="1000px"> <telerik:RadTabStrip runat="server" ID="TabStip" MultiPageID="Multipage" SelectedIndex="0" Skin="WebBlue"> <Tabs> <telerik:RadTab runat="server" Text="General" PageViewID="General"/> <telerik:RadTab runat="server" Text="Status" PageViewID="Status"/> <telerik:RadTab runat="server" Text="Coverage" PageViewID="Coverage"/> <telerik:RadTab runat="server" Text="Rejection" PageViewID="Rejection"/> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage runat="server" ID="Multipage" SelectedIndex="0" RenderSelectedPageOnly="false" Height="90px"> <telerik:RadPageView runat="server" ID="Genearal"> <table> <tr> <td><b> Name:</b></td> <td><asp:Label id="Label0" runat="server" Text='<%# Eval("ItemName") %>' /></td> </tr> <tr> <td><b> Source:</b></td> <td><asp:Label id="Label1" runat="server" Text='<%# Eval("ItemSource") %>' /></td> </tr> <tr> <td><b> Type:</b></td> <td><asp:Label id="Label2" runat="server" Text='<%# Eval("ItemType") %>' /></td> </tr> <tr> <td><b> Acq. Number:</b></td> <td><asp:Label id="Label3" runat="server" Text='<%# Eval("ItemAcqNumber") %>' /></td> </tr> <tr> <td><b> Description:</b></td> <td><asp:Label id="Label4" runat="server" Text='<%# Eval("ItemDescription") %>' /></td> </tr> </table> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="Status"> <table> <tr> <td><b> Status:</b></td> <td><asp:Label id="Label6" runat="server" Text='<%# Eval("ItemStatus") %>' /></td> </tr> <tr> <td><b> Date:</b></td> <td><asp:Label id="Label7" runat="server" Text='<%# Eval("ItemStatusDate") %>' /></td> </tr> <tr> <td><b> Detail:</b></td> <td><asp:Label id="Label8" runat="server" Text='<%# Eval("ItemStatusDetail") %>' /></td> </tr> </table> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="Coverage"> <table> <tr> <td><b> Coverage 1:</b></td> <td><asp:Label id="Label9" runat="server" Text='<%# Eval("ItemCoverage1") %>' /></td> </tr> <tr> <td><b> Coverage 2:</b></td> <td><asp:Label id="Label10" runat="server" Text='<%# Eval("ItemCoverage2") %>' /></td> </tr> <tr> <td><b> Coverage 2 Type:</b></td> <td><asp:Label id="Label11" runat="server" Text='<%# Eval("ItemCoverage3Description") %>' /></td> </tr> </table> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="Rejection"> <table> <tr> <td><b> Report Delivery:</b></td> <td><asp:Label id="Label12" runat="server" Text="Email" /></td> </tr> <tr> <td><b> Indicator:</b></td> <td><asp:Label id="Label13" runat="server" Text="abc" /></td> </tr> <tr> <td><b> Email Recipients:</b></td> <td><asp:Label id="Label14" runat="server" Text="joe@mail.com|jane@mail.com" /></td> </tr> <tr> <td><b> Node Id:</b></td> <td><asp:Label id="Label15" runat="server" Text="1234" /></td> </tr> <tr> <td><b> FTP Name:</b></td> <td><asp:Label id="Label16" runat="server" Text="ftp://server.com" /></td> </tr> </table> </telerik:RadPageView> </telerik:RadMultiPage> </asp:Panel> </ItemTemplate> </asp:FormView> <asp:ObjectDataSource runat="server" ID="ObjectDataSource" SelectMethod="Get" TypeName="Orbit3UI.Model.MasterItemDetailsDataSource"> <SelectParameters> <asp:ControlParameter ControlID="ItemName" Name="ItemName" PropertyName="Text" /> <asp:ControlParameter ControlID="ItemSource" Name="ItemSource" PropertyName="Text" /> </SelectParameters> </asp:ObjectDataSource> </NestedViewTemplate> </MasterTableView> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu> </telerik:RadGrid> So what can I do in order to have this work for both sorting/filtering as well as hierarchy expansion?
BTW, I do my own sorting/filtering as well as paging since I cannot load all the records from the database at once.
I am wondering if by intercepting an event and doing something I can stop the grid from trying to interact with the FormView in the NestedTemplateView at all since all I want is to sort the Master Table! .
Thanks.
Sal
<telerik:RadGrid ID="OrbitRadGrid" runat="server" AllowFilteringByColumn="True" AllowSorting="True" VirtualItemCount="50000" GridLines="None" AllowPaging="true" PageSize="30" AllowCustomPaging="true" ShowGroupPanel="false" EnableLinqExpressions="false" OnNeedDataSource="OrbitRadGrid_NeedDataSource" OnSortCommand="OrbitRadGrid_SortCommand" Skin="WebBlue" > <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="False" ReorderColumnsOnClient="True"> <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True" SaveScrollPosition="True" /> <Resizing AllowColumnResize="True" /> </ClientSettings> <MasterTableView DataKeyNames="Item_Name, Source_Name" AutoGenerateColumns="False" AllowNaturalSort="false"> <Columns> <telerik:GridBoundColumn DataField="Item_Name" HeaderText="Item Name" ReadOnly="True" SortExpression="Item_Name" UniqueName="Item_Name" HeaderStyle-Width="220px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Source_Name" HeaderText="Item Source" ReadOnly="True" SortExpression="Source_Name" UniqueName="Source_Name" HeaderStyle-Width="220px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ItemType_Name" HeaderText="Item Type" ReadOnly="True" SortExpression="ItemType_Name" UniqueName="ItemType_Name" HeaderStyle-Width="115px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Team_Name" HeaderText="Item Team" ReadOnly="True" SortExpression="Team_Name" UniqueName="Team_Name" HeaderStyle-Width="115px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IsTestItem" HeaderText="Test" ReadOnly="True" UniqueName="IsTestItem" AllowFiltering="false" HeaderStyle-Width="50px"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="IsItemOnHold" HeaderText="On Hold" ReadOnly="True" UniqueName="IsItemOnHold" AllowFiltering="false" HeaderStyle-Width="62px"> </telerik:GridBoundColumn> </Columns> <NestedViewSettings DataSourceID="MasterItemsDetails" > <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="ItemName" MasterKeyField="Item_Name" /> <telerik:GridRelationFields DetailKeyField="ItemSource" MasterKeyField="Source_Name" /> </ParentTableRelation> </NestedViewSettings> <NestedViewTemplate> <asp:FormView ID="FormView" runat="server" DataSourceID="MasterItemsDetails"> <ItemTemplate> <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap"> <div class="contactWrap"> <table> <tr> <td> <fieldset style="padding: 10px;"> <legend style="padding: 5px;"><b>General info</b></legend> <table width="400"> ... </table> </fieldset> </td> <td> <table width="200"> <tr> <td> <fieldset style="padding: 10px;"> <legend style="padding: 5px;"><b>Status</b></legend> <table> ... </table> </fieldset> </td> </tr> <tr> <td> <fieldset style="padding: 10px;" > <legend style="padding: 5px;"><b>Coverage</b></legend> <table> ... </table> </fieldset> </td> </tr> </table> </td> <td> <fieldset style="padding: 10px;" > <legend style="padding: 5px;"><b>Rejection Information</b></legend> <table width="300"> ... </table> </fieldset> </td> </tr> </table> </div> </asp:Panel> </ItemTemplate> </asp:FormView> </NestedViewTemplate> </MasterTableView> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu> </telerik:RadGrid> <asp:ObjectDataSource runat="server" ID="MasterItemsDetails" SelectMethod="Get" TypeName="Orbit3UI.Model.MasterItemDetailsDataSource"> <SelectParameters> <asp:Parameter Name="itemName" Type="String" /> <asp:Parameter Name="itemSource" Type="String" /> </SelectParameters> </asp:ObjectDataSource>