| Hello, I have 3 grids nested inside a main grid using the NestedViewTemplate. Everything works fine for binding and displaying the data. The problem is I want to use a CommandItemTemplate in the nested grid to popup another window for inserting new parts. I can make the window pop-up, I just can not get the primary key from the top level grid to go with it. I have tried all kinds of stuff, but I was hoping to do something like the snippet below to include the PlanID as an argument to my javascript function:
I am open to C# code behind to set the onclick attributes or javascript to dig around if necessary to get the PlanID from the parent grid or the nested grid, it exists in both. I have inserted sample markup below if that helps. Thanks! Tom (Sorry for the blue, I should have typed before using the format code block?) <telerik:RadGrid ID="gridJobPlans" runat="server" DataSourceID="objJobPlans" |
||||
| GridLines="None" AllowFilteringByColumn="True" AllowSorting="True" | ||||
| AutoGenerateColumns="False" | ||||
| onupdatecommand="gridJobPlans_UpdateCommand" | ||||
| > | ||||
| <MasterTableView DataKeyNames="ID" | ||||
| DataSourceID="obj1" CommandItemDisplay="TopAndBottom"> | ||||
| <NestedViewTemplate> | ||||
| <asp:Label ID="PlanID" runat="server" Text='<%# Eval("ID") %>' /> | ||||
| <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="1" | ||||
| MultiPageID="MultiPageSelectedJobPlan"> | ||||
| <Tabs> | ||||
| <telerik:RadTab runat="server" Text="Documents" | ||||
| PageViewID="SelectedJobPlanDocs"> | ||||
| </telerik:RadTab> | ||||
| </Tabs> | ||||
| </telerik:RadTabStrip> | ||||
| <telerik:RadMultiPage ID="MultiPageSelectedJobPlan" Runat="server" | ||||
| Width="703px" SelectedIndex="2"> | ||||
| <telerik:RadPageView ID="Parts" runat="server"> | ||||
| <telerik:RadGrid ID="Grid" runat="server" | ||||
| AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" | ||||
| AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" | ||||
| DataSourceID="objSelected2" GridLines="None" AllowAutomaticDeletes="true"> | ||||
| <MasterTableView AutoGenerateColumns="False" DataKeyNames="ID, PlanID" | ||||
| CommandItemDisplay="TopAndBottom"> | ||||
| <Columns> | ||||
| <telerik:GridBoundColumn DataField="ID" DataType="System.Int64" HeaderText="ID" | ||||
| ReadOnly="True" SortExpression="ID" UniqueName="ID" Display="false"> | ||||
| </telerik:GridBoundColumn> | ||||
| <telerik:GridBoundColumn DataField="PlanID" DataType="System.Int64" | ||||
| HeaderText="PlanID" SortExpression="PlanID" UniqueName="PlanID" Display="true"> | ||||
| </telerik:GridBoundColumn> | ||||
| </Columns> | ||||
| <CommandItemTemplate> | ||||
| <asp:Label ID="lblAddNewPart" Text="Add" runat="server"/> | ||||
| <a href="#" onclick="return ShowAddPartForm('<%# Bind( "PlanID" ) %>');">Add New </a> | ||||
| </CommandItemTemplate> | ||||
| </MasterTableView> | ||||
| </telerik:RadGrid> | ||||
| </telerik:RadPageView> | ||||
| </telerik:RadMultiPage> | ||||
| </NestedViewTemplate> | ||||
| </MasterTableView> | ||||
| </telerik:RadGrid> | ||||