This is a migrated thread and some comments may be shown as answers.

[Solved] Find the button in side Nested Hierarchy Grid

2 Answers 146 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Suresh K
Top achievements
Rank 1
Suresh K asked on 12 Sep 2009, 01:07 PM


hi.,
Can any one help me plese...
now i want to fine the  btnfront,btnback, buttons  and frameimage iframe
how to find the button in side Nested Hierarchy Grid.,
 <telerik:RadGrid ID="RadGrid1" runat="server" Skin="trublue" EnableEmbeddedSkins="False" 
                GridLines="None" Style="left: 25px; position: relative; top: 14px; text-align: left;" 
                Width="750px" AllowPaging="True" PageSize="20" AutoGenerateColumns="False"
                <PagerStyle Mode="NumericPages" /> 
                <HeaderContextMenu EnableEmbeddedSkins="False"
                </HeaderContextMenu> 
                <MasterTableView DataKeyNames="TransactionsID"
                    <DetailTables> 
                        <telerik:GridTableView Name="TransDetails" runat="server" DataKeyNames="CheckNumber"
                            <NestedViewTemplate> 
                                <asp:Panel ID="Container" runat="server"
                                    <telerik:RadTabStrip ID="Gridtab1" runat="server" Skin="trublue" EnableEmbeddedSkins="False" 
                                        MultiPageID="gridmultypage1"
                                        <Tabs> 
                                            <telerik:RadTab runat="server" PageViewID="gridpageview1" Selected="true" Text="Transactions Details"
                                            </telerik:RadTab> 
                                            <telerik:RadTab runat="server" PageViewID="gridpageview2" Selected="true" Text="Attachment Details"
                                            </telerik:RadTab> 
                                        </Tabs> 
                                    </telerik:RadTabStrip> 
                                    <telerik:RadMultiPage ID="gridmultypage1" SelectedIndex="0" runat="server"
                                        <telerik:RadPageView ID="gridpageview1" runat="server"
                                            <br /> 
                                            <table style="position: static; text-align: left"
                                                <tbody> 
                                                    <tr> 
                                                        <td style="width: 100px"
                                                        </td> 
                                                        <td style="width: 100px"
                                                            <asp:Label Style="position: static" ID="lblchkno" runat="server" Width="115px" Text="Cheque Number"
                                                            </asp:Label></td
                                                        <td> 
                                                            :</td> 
                                                        <td style="width: 224px"
                                                            <asp:Label Style="position: static" ID="lblchequenumber" runat="server" Width="260px"></asp:Label> 
                                                        </td> 
                                                        <td style="width: 12px"
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width: 100px"
                                                        </td> 
                                                        <td style="width: 100px"
                                                            <asp:Label Style="position: static" ID="lblchkamount" runat="server" Text="Cheque Amount"
                                                            </asp:Label></td
                                                        <td> 
                                                            :</td> 
                                                        <td style="width: 224px"
                                                            <asp:Label Style="position: static" ID="lblchequeamount" runat="server" Width="260px"></asp:Label> 
                                                        </td> 
                                                        <td style="width: 12px"
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width: 100px"
                                                        </td> 
                                                        <td style="width: 100px"
                                                            <asp:Label Style="position: static" ID="lblchkdate" runat="server" Text="Cheque Date"></asp:Label></td
                                                        <td> 
                                                            :</td> 
                                                        <td style="width: 224px"
                                                            <asp:Label Style="position: static" ID="lblchequedate" runat="server" Width="260px"></asp:Label> 
                                                        </td> 
                                                        <td style="width: 12px"
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width: 100px"
                                                        </td> 
                                                        <td style="width: 100px"
                                                            <asp:Label Style="position: static" ID="lblcltname" runat="server" Text="Client Name"></asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            :</td> 
                                                        <td style="width: 224px"
                                                            <asp:Label Style="position: static" ID="lblclientname" runat="server" Width="260px"></asp:Label> 
                                                        </td> 
                                                        <td style="width: 12px"
                                                        </td> 
                                                    </tr> 
                                                    <tr> 
                                                        <td style="width: 100px"
                                                        </td> 
                                                        <td style="width: 100px"
                                                            <asp:Label Style="position: static" ID="lblbnkname" runat="server" Text="Bank Name"></asp:Label> 
                                                        </td> 
                                                        <td> 
                                                            :</td> 
                                                        <td style="width: 224px"
                                                            <asp:Label Style="position: static" ID="lblbankname" runat="server" Width="260px"></asp:Label> 
                                                        </td> 
                                                        <td style="width: 12px"
                                                        </td> 
                                                    </tr> 
                                                </tbody> 
                                            </table> 
                                            <br /> 
                                        </telerik:RadPageView> 
                                        <telerik:RadPageView ID="RadPageView2" runat="server"
                                            <br /> 
                                            <table> 
                                                <tr> 
                                                    <td> 
                                                        <telerik:RadGrid ID="RadGridDD" Skin="trublue" EnableEmbeddedSkins="False" runat="server" 
                                                            AutoGenerateColumns="false"
                                                            <ClientSettings> 
                                                                <Selecting AllowRowSelect="true" /> 
                                                            </ClientSettings> 
                                                            <MasterTableView> 
                                                                <Columns> 
                                                                    <telerik:GridTemplateColumn> 
                                                                        <HeaderTemplate> 
                                                                            Download 
                                                                        </HeaderTemplate> 
                                                                        <ItemTemplate> 
                                                                            <asp:LinkButton ID="btndownload" runat="server" Text="Download" OnClick="btndownload_click"></asp:LinkButton> 
                                                                        </ItemTemplate> 
                                                                    </telerik:GridTemplateColumn> 
                                                                    <telerik:GridBoundColumn DataField="id" HeaderText="id" UniqueName="id" Visible="false"
                                                                    </telerik:GridBoundColumn> 
                                                                    <telerik:GridBoundColumn DataField="transno" HeaderText="transno" UniqueName="transno" 
                                                                        Visible="false"
                                                                    </telerik:GridBoundColumn> 
                                                                    <telerik:GridBoundColumn DataField="docname" HeaderText="Document Name" UniqueName="docname"
                                                                    </telerik:GridBoundColumn> 
                                                                    <telerik:GridBoundColumn DataField="filename" HeaderText="File Name" UniqueName="filename"
                                                                    </telerik:GridBoundColumn> 
                                                                </Columns> 
                                                            </MasterTableView> 
                                                        </telerik:RadGrid> 
                                                    </td> 
                                                </tr> 
                                                <tr> 
                                                    <td> 
                                                        <table style="position: static"
                                                            <tr> 
                                                                <td style="width: 100px"
                                                                    <asp:Button ID="btnfront" runat="server" Style="position: static" OnClick="btnfrontgrd_click" Enabled="false" 
                                                                         Text="View Front" /></td
                                                                <td style="width: 100px"
                                                                    <asp:Button ID="btnback" runat="server" Style="position: static" OnClick="btnbackgrd_click" Enabled="false" 
                                                                         Text="View Back" /></td
                                                                <td style="width: 100px"
                                                                </td> 
                                                                <td style="width: 100px"
                                                                </td> 
                                                                <td style="width: 100px"
                                                                </td> 
                                                                <td style="width: 100px"
                                                                </td> 
                                                                <td style="width: 100px"
                                                                </td> 
                                                                <td style="width: 100px"
                                                                    <asp:Button ID="btndownloadgrd" runat="server" Style="position: static" OnClick="btndownloadgrd_click" Enabled="false" 
                                                                         Text="Download" /></td
                                                                <td style="width: 100px"
                                                                    <asp:Button ID="btnprintgrd" runat="server" Style="position: static" Text="Print" 
                                                                        Visible="False" /></td
                                                            </tr> 
                                                        </table> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                            <br /> 
                                            <iframe id="frameimage" style="overflow: scroll;" runat="server" width="674px" height="640px"
                                            </iframe> 
                                        </telerik:RadPageView> 
                                    </telerik:RadMultiPage> 
                                </asp:Panel> 
                            </NestedViewTemplate> 
                            <Columns> 
                                <telerik:GridBoundColumn DataField="CheckNumber" HeaderText="CheckNumber" UniqueName="CheckNumber"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="CheckDate" HeaderText="CheckDate" UniqueName="CheckDate"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="CheckReceivedOn" HeaderText="CheckReceivedOn" 
                                    UniqueName="CheckReceivedOn"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="CheckAmount" HeaderText="CheckAmount" UniqueName="CheckAmount"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="DepositeDate" HeaderText="DepositeDate" UniqueName="DepositeDate"
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="InvoiceNo" HeaderText="InvoiceNo" UniqueName="InvoiceNo"
                                </telerik:GridBoundColumn> 
                            </Columns> 
                            <ExpandCollapseColumn Visible="True"
                            </ExpandCollapseColumn> 
                            <EditFormSettings> 
                                <EditColumn CancelImageUrl="trublue/Grid/Cancel.gif" EditImageUrl="trublue/Grid/Edit.gif" 
                                    InsertImageUrl="trublue/Grid/Update.gif" UpdateImageUrl="trublue/Grid/Update.gif"
                                </EditColumn> 
                            </EditFormSettings> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="TransactionsID" HeaderText="TransactionsID" UniqueName="TransactionsID"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="DepositeDate" HeaderText="DepositeDate" UniqueName="DepositeDate"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="ChecksCount" HeaderText="ChecksCount" UniqueName="ChecksCount"
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="TotalAmount" HeaderText="TotalAmount" UniqueName="TotalAmount"
                        </telerik:GridBoundColumn> 
                    </Columns> 
                    <ExpandCollapseColumn Visible="True"
                    </ExpandCollapseColumn> 
                    <EditFormSettings> 
                        <EditColumn CancelImageUrl="trublue/Grid/Cancel.gif" EditImageUrl="trublue/Grid/Edit.gif" 
                            InsertImageUrl="trublue/Grid/Update.gif" UpdateImageUrl="trublue/Grid/Update.gif"
                        </EditColumn> 
                    </EditFormSettings> 
                </MasterTableView> 
                <ClientSettings> 
                    <Selecting AllowRowSelect="True" /> 
                    <ClientEvents OnRowDblClick="RowDblClicked" /> 
                </ClientSettings> 
                <FilterMenu EnableEmbeddedSkins="False"
                </FilterMenu> 
            </telerik:RadGrid> 

Thank you.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 14 Sep 2009, 06:34 AM
Hello Suresh,

You can try out the following code to access the nestedviewtemplate controls:
c#:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item.ItemType == GridItemType.NestedView && e.Item.OwnerTableView.Name == "TransDetails"
        { 
            GridNestedViewItem nestedItem = (GridNestedViewItem)e.Item;           
            Button btn1 = (Button)nestedItem.FindControl("btnfront"); 
            Button btn2 = (Button)nestedItem.FindControl("btnback"); 
            HtmlGenericControl cntr = (HtmlGenericControl)nestedItem.FindControl("frameimage"); 
        } 
    } 

Thanks
Princy.
0
Suresh K
Top achievements
Rank 1
answered on 14 Sep 2009, 07:03 AM
thank u princy
nice solutions
Tags
Grid
Asked by
Suresh K
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Suresh K
Top achievements
Rank 1
Share this question
or