Hello,
I've seen a lot of examples to access to DataKeyValues from DetailTables, but I cannot find an example about doing the same in NestedViewTemplates.
Here is my RadGrid:
How can I get parent DataKeyValues from a child ItemCommand event? I need the CustomerId value in order to pass this parameter to another page.
Any idea?
Thanks a lot in advanced,
Jose
I've seen a lot of examples to access to DataKeyValues from DetailTables, but I cannot find an example about doing the same in NestedViewTemplates.
Here is my RadGrid:
<telerik:RadGrid ID="ListGrid" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" GridLines="None" ShowStatusBar="True" ShowGroupPanel="True" onneeddatasource="ListGrid_NeedDataSource" onitemcommand="ListGrid_ItemCommand"> <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True"> <Selecting AllowRowSelect="True" /> </ClientSettings> <MasterTableView DataKeyNames="CustomerId" CommandItemDisplay="Top"> <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings> <RowIndicatorColumn> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <NestedViewTemplate> <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap"> <telerik:RadTabStrip runat="server" ID="CustomersTabStrip" MultiPageID="CustomersMultipage" SelectedIndex="0"> <Tabs> <telerik:RadTab runat="server" Text="Contacts" PageViewID="ContactsPageView"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Addresses" PageViewID="AddressesPageView"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip> <telerik:RadMultiPage runat="server" ID="CustomersMultipage" SelectedIndex="0" RenderSelectedPageOnly="false"> <telerik:RadPageView runat="server" ID="ContactsPageView"> <telerik:RadGrid runat="server" ID="ContactsGrid" AllowSorting="true" DataKeyNames="ContactId" onneeddatasource="ContactsGrid_NeedDataSource" onitemcommand="ContactsGrid_ItemCommand"> <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="ContactId" PageSize="5" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top"> <Columns> <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False" Resizable="False" ShowFilterIcon="False" ShowSortIcon="False" UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit"> <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" /> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="ContactId" HeaderText="Id" UniqueName="ContactId" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Full Name" DataField="FullName" UniqueName="FullName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Position" DataField="Position" UniqueName="Position"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Contact Type" DataField="ContactType.Description" UniqueName="ContactType"> </telerik:GridBoundColumn> <telerik:GridHyperLinkColumn DataNavigateUrlFields="Email" DataNavigateUrlFormatString="mailto:{0}" DataTextField="Email" HeaderText="Email" UniqueName="Email" Groupable="false" AllowFiltering="false"> </telerik:GridHyperLinkColumn> <telerik:GridBoundColumn HeaderText="Phone" DataField="Phone" UniqueName="Phone"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Mobile" DataField="Mobile" UniqueName="Mobile"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False" Resizable="False" ShowFilterIcon="False" ShowSortIcon="False" UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..." ConfirmDialogHeight="130px"> <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" /> </telerik:GridButtonColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="AddressesPageView"> <telerik:RadGrid runat="server" ID="AddressesGrid" AllowSorting="true" DataKeyNames="AddressId" onneeddatasource="AddressesGrid_NeedDataSource" onitemcommand="AddressesGrid_ItemCommand"> <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" DataKeyNames="AddressId" PageSize="5" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top"> <Columns> <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False" Resizable="False" ShowFilterIcon="False" ShowSortIcon="False" UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit"> <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" /> </telerik:GridButtonColumn> <telerik:GridBoundColumn DataField="AddressId" HeaderText="Id" UniqueName="AddressId" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Address Type" DataField="AddressType" UniqueName="AddressType"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Full Address" DataField="FullAddress" UniqueName="FullAddress"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Zip Code" DataField="ZipCode" UniqueName="ZipCode"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="City" DataField="City" UniqueName="City"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Province" DataField="Province" UniqueName="Province"> </telerik:GridBoundColumn> <telerik:GridBoundColumn HeaderText="Country" DataField="Country" UniqueName="Country"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False" Resizable="False" ShowFilterIcon="False" ShowSortIcon="False" UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..." ConfirmDialogHeight="130px"> <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" /> </telerik:GridButtonColumn> </Columns> </MasterTableView> </telerik:RadGrid> </telerik:RadPageView> </telerik:RadMultiPage> </asp:Panel> </NestedViewTemplate> <Columns> <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False" Resizable="False" ShowFilterIcon="False" ShowSortIcon="False" UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit"> <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" /> </telerik:GridButtonColumn> <telerik:GridImageColumn AllowFiltering="False" AllowSorting="False" DataAlternateTextField="Name" DataImageUrlFields="Logo" DataImageUrlFormatString="~/Images/Customers/{0}" Groupable="False" HeaderText="Logo" ImageHeight="64px" ImageWidth="64px" ShowSortIcon="False" UniqueName="Logo" ItemStyle-Width="75px"> <ItemStyle Width="75px" /> </telerik:GridImageColumn> <telerik:GridBoundColumn DataField="CustomerId" HeaderText="Id" UniqueName="CustomerId" Visible="false"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name"> </telerik:GridBoundColumn> <telerik:GridHyperLinkColumn DataNavigateUrlFields="Web" DataNavigateUrlFormatString="{0}" DataTextField="Web" HeaderText="Web" UniqueName="Web" Target="_blank" Groupable="false" AllowFiltering="false"> </telerik:GridHyperLinkColumn> <telerik:GridBoundColumn DataField="Group.Name" HeaderText="Group" UniqueName="Group"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="AccountManager.FullName" HeaderText="Acct. Manager" UniqueName="AccountManager"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="SIC.Description" HeaderText="SIC" UniqueName="SIC"> </telerik:GridBoundColumn> <telerik:GridCheckBoxColumn DataField="IsProspect" HeaderText="Prospect" UniqueName="IsProspect"> </telerik:GridCheckBoxColumn> <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False" Resizable="False" ShowFilterIcon="False" ShowSortIcon="False" UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..." ConfirmDialogHeight="130px"> <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" /> </telerik:GridButtonColumn> </Columns> </MasterTableView> <PagerStyle Mode="NextPrevAndNumeric" Position="Bottom" /> <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu> </telerik:RadGrid>How can I get parent DataKeyValues from a child ItemCommand event? I need the CustomerId value in order to pass this parameter to another page.
Any idea?
Thanks a lot in advanced,
Jose