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

[Solved] Hide table header for second detail table etc

1 Answer 288 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 2
Iron
Iron
Iron
Morten asked on 05 Sep 2009, 05:39 PM
Hi,

I have a table with a detail table. Is it possible to remove the table header from the detail tables except from the first detail table? (There are soooooo many table headers on the page...)
 


1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Sep 2009, 05:19 AM
Hi Morten,

Set the Name property and try with the following approach to hide the Header row for desired detail tables. Here is a sample code which hides the header for all the detail tables other than the first.

ASPX:
 
 
<MasterTableView  Name="Master" GridLines="Vertical" > 
       ..........              
                    <DetailTables> 
                        <telerik:GridTableView runat="server" Caption="Detail1" Name="Detail1" 
                            DataSourceID="SqlDataSource1"
                            ..... 
                            <DetailTables> 
                                <telerik:GridTableView runat="server"  Caption="Detail3" Name="Detail3" 
                                    DataSourceID="SqlDataSource2"
                                   ....... 
                                </telerik:GridTableView> 
                            </DetailTables> 
                        </telerik:GridTableView> 
                    </DetailTables> 
                    <DetailTables> 
                        <telerik:GridTableView runat="server"  Caption="Detail2" Name="Detail2" 
                            DataSourceID="SqlDataSource1"
                            ........ 
                        </telerik:GridTableView> 
                    </DetailTables> 
                </MasterTableView> 

CS:
 
 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if ((e.Item.OwnerTableView.Name != "Detail1") && ((e.Item.OwnerTableView.Name != "Master"))) 
        { 
            e.Item.OwnerTableView.ShowHeader = false
        } 
    } 







Thanks
Shinu


Tags
Grid
Asked by
Morten
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Shinu
Top achievements
Rank 2
Share this question
or