Hi,
I put a Panel in the nestedViewTemplate of a RadGrid. On the panel, I have a toolBar, then a inner grid.
What I want is:
When I click the button (export) on the toolBar, I will export the content of the inner grid.
What I did is:
I attached a OnOnClick="toolSearchResultsInner_OnClick" to the toolBar. In the code behind, I will set the export formatting for the innerGrid.
The problem is:
1) I can't get the reference control (inner grid) in the toolSearchResultsInner_OnClick event.
2) I searched a lot and found that people suggested using outGrid.itemCreated to access the controls inside the nestedViewTemplate. However, in my case, I want to export the inner grid only when I click the export button on the toolBar.
Can anybody help me?
Here is the code:
Best regards,
Heng
I put a Panel in the nestedViewTemplate of a RadGrid. On the panel, I have a toolBar, then a inner grid.
What I want is:
When I click the button (export) on the toolBar, I will export the content of the inner grid.
What I did is:
I attached a OnOnClick="toolSearchResultsInner_OnClick" to the toolBar. In the code behind, I will set the export formatting for the innerGrid.
The problem is:
1) I can't get the reference control (inner grid) in the toolSearchResultsInner_OnClick event.
2) I searched a lot and found that people suggested using outGrid.itemCreated to access the controls inside the nestedViewTemplate. However, in my case, I want to export the inner grid only when I click the export button on the toolBar.
Can anybody help me?
Here is the code:
| <Telerik:RadGrid ID="dgResults" runat="server" AllowPaging="True" AllowSorting="True"> |
| <MasterTableView > |
| <NestedViewSettings > |
| <ParentTableRelation> |
| <telerik:GridRelationFields DetailKeyField="GeneralID" MasterKeyField="GeneralID" /> |
| </ParentTableRelation> |
| </NestedViewSettings> |
| <NestedViewTemplate> |
| <asp:Panel runat="server" ID="InnerContainer" CssClass ="viewWrap" Visible="true"> |
| <radtlb:radtoolbar runat="server" id="toolSearchResults1" OnOnClick="toolSearchResultsInner_OnClick" AutoPostBack="true"> |
| <items> |
| <radtlb:radtoolbarbutton ID="toolExport" DisplayType="TextImage" CommandName="Export to Excel" ButtonImage="IFExcel.jpg" Hidden="False" runat="server" style=" font-weight:normal;font-family:Tahoma" ButtonText="Export" /> |
| <radTlb:RadToolbarSeparator ID="RadToolbarSeparator31" runat="server" /> |
| <radtlb:radtoolbarbutton ID="toolPrint" DisplayType="TextImage" CommandName="Print" ButtonImage="print.gif" Hidden="False" runat="server" style=" font-weight:normal;font-family:Tahoma" ButtonText="Print" /> |
| </item></radtlb:radtoolbar> |
| <telerik:radGrid ID ="innerGrid" runat ="server" AllowPaging="True" AllowSorting="True" OnExcelExportCellFormatting="Inner_ExcelExportCellFormatting" |
| </MasterTableView > |
| <MasterTableView TableLayout ="auto" > |
| </MasterTableView> |
| </telerik:radGrid> |
| </asp:Panel> |
| </NestedViewTemplate> |
| </MasterTableView> |
| </Telerik:RadGrid> |
Best regards,
Heng