or
<telerik:RadGrid ID="radgrid" runat="server" AutoGenerateColumns="false" Skin="Silk" Width="90%" Visible="false" AllowMultiRowSelection="true" AllowSorting="true" AllowPaging="true" ShowStatusBar="true" EnableLinqExpressions="false" OnItemDataBound="radgrid_ItemDataBound" OnDataBound="radgrid_DataBound" CellSpacing="0" GridLines="None" OnPageIndexChanged="radgrid_PageIndexChanged" >
<ClientSettings AllowDragToGroup="true" EnableRowHoverStyle="true" AllowColumnsReorder="true"
Selecting-AllowRowSelect="true" ClientEvents-OnRowDeselected="UnCheckGroup" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder"> <Animation AllowColumnReorderAnimation="true" AllowColumnRevertAnimation="true"></Animation>
</ClientSettings>
<MasterTableView DataSourceID="ods" DataKeyNames="ID" GroupLoadMode="Client" GroupsDefaultExpanded="false" GroupHeaderItemStyle-HorizontalAlign="Left"> <GroupHeaderTemplate> <asp:Label runat="server" ID="Label1" ForeColor="#2F4F4F" Text="Id: "></asp:Label> <asp:Label runat="server" ID="Label3" Text='<%# (((GridGroupHeaderItem)Container).AggregatesValues["ID"]) %>'></asp:Label> <asp:Label runat="server" ID="Label2" ForeColor="#2F4F4F" Text="Date: "></asp:Label> <asp:Label runat="server" ID="Label6" Text='<%# (((GridGroupHeaderItem)Container).AggregatesValues["Date"]) %>'></asp:Label> <asp:Label runat="server" ID="Label7" ForeColor="#2F4F4F" Text="Price: $"></asp:Label> <asp:Label runat="server" ID="Label8" Text='<%# (((GridGroupHeaderItem)Container).AggregatesValues["Price"]) %>'></asp:Label> </GroupHeaderTemplate> <Columns> <telerik:GridBoundColumn DataField="ProductName" UniqueName="ProductName" HeaderText="Product"> <HeaderStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Amount" UniqueName="Amount" HeaderText="Amount"> <HeaderStyle HorizontalAlign="Center" /> <HeaderStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> </Columns> <GroupByExpressions> <telerik:GridGroupByExpression> <GroupByFields> <telerik:GridGroupByField FieldName="ParentGroupID"/> </GroupByFields> </GroupByExpressions> <telerik:GridGroupByExpression> <SelectFields> <telerik:GridGroupByField FieldName="ID"/> </SelectFields> <SelectFields> <telerik:GridGroupByField FieldName="Date"/> </SelectFields> <SelectFields> <telerik:GridGroupByField FieldName="Price" FormatString="{0:C}"/> </SelectFields> <GroupByFields> <telerik:GridGroupByField FieldName="ID"/> </GroupByFields> </telerik:GridGroupByExpression> </GroupByExpressions>
</MasterTableView>
</telerik:RadGrid>
<asp:ObjectDataSource ID="ods" runat="server" SelectMethod="ListItems" TypeName="...my namespace ..."></asp:ObjectDataSource>Hello,
I created a simple RadGrid with a NestedViewTemplate and a SqlDataSource1, no code behind involve. When I click
expand link and show the static text inside the NestedViewTemplate, I get javascript runtime error:
Unhandled exception at line 6, column 74203 in http://localhost:49573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:d618f02c-bda7-40f1-bb64-308e08f719c3:ea597d4b:b25378d2;Telerik.Web.UI:en-US:ac331549-681c-4402-9fb7-09ec3c579ee8:16e4e7cd:f7645509:22a6274a:ed16cbdc:58366029:24ee1bba:f46195d3:2003d0b8:88144a7a:1e771326:aa288e2d
0x800a138f - JavaScript runtime error: Unable to set property 'control' of undefined or null reference
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" /> </Scripts> </telerik:RadScriptManager> <script type="text/javascript"> //Put your JavaScript code here. </script> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> </telerik:RadAjaxManager> <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="true"> <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"> <Columns> <telerik:GridBoundColumn DataField="ProductID" DataType="System.Int32" FilterControlAltText="Filter ProductID column" HeaderText="ProductID" ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ProductNumber" FilterControlAltText="Filter ProductNumber column" HeaderText="ProductNumber" SortExpression="ProductNumber" UniqueName="ProductNumber"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Size" FilterControlAltText="Filter Size column" HeaderText="Size" SortExpression="Size" UniqueName="Size"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Color" FilterControlAltText="Filter Color column" HeaderText="Color" SortExpression="Color" UniqueName="Color"> </telerik:GridBoundColumn> <telerik:GridCheckBoxColumn DataField="MakeFlag" DataType="System.Boolean" FilterControlAltText="Filter MakeFlag column" HeaderText="MakeFlag" SortExpression="MakeFlag" UniqueName="MakeFlag"> </telerik:GridCheckBoxColumn> </Columns> <NestedViewTemplate> dssfaddfssd </NestedViewTemplate> </MasterTableView> </telerik:RadGrid> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AdventureWorks2008R2ConnectionString %>" SelectCommand="SELECT [ProductID], [Name], [ProductNumber], [Size], [Color], [MakeFlag] FROM [Production].[Product]"></asp:SqlDataSource>
If above code added to a RadControlWebApp project, it is running fine. But if it added to a existing ASP.NET
Web Forms Application. Also, I made sure that Telerik.Web.UI and Skins are added to references and web.config
What am I missing here to make NestedViewTemplate to work? It stopped working in Q3 2013 after upgraded.
Thanks in advance
Sam
int ParentId = RadGrid1.MasterTableView.DataKeyValues[
int.Parse(e.Item.OwnerTableView.ParentItem.ItemIndexHierarchical)]["Id"].ToString();
but when i want update DetailTable(1) i can not use this code :
int ParentId = RadGrid1.MasterTableView.DetailTables[0].DataKeyValues[int.Parse(e.Item.OwnerTableView.ParentItem.ItemIndexHierarchical)][
"Id"].ToString();
// erro ocured and i can not use :((
maybe my method completly is uncurrect.