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

[Solved] Grid Hierarchy - Position of two tables at the same level

3 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 07 May 2009, 03:09 AM
Hi,

I have a Grid which has the ability to expand a row to show further information.  When the parent row is expanded, the child level shows two tables.

I need the first table to display under the first column of the parent row and the second table to display under the 5th column of the parent row.

Is there a way of positioning the child tables so that they are underneath the relevant columns instead of being on top of each other, directly under the first column?

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 May 2009, 05:47 AM
Hello,

If you want to display the Detail tables at the same level, side by side then you would have to set the HorizontalAlign property of the DetailTables as shown below:
c#:
 <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server">            
            <MasterTableView DataSourceID="SqlDataSource1"
             <DetailTables> 
             <telerik:GridTableView HorizontalAlign="Left" DataSourceID="SqlDataSource1"
             .....             
             </telerik:GridTableView> 
             </DetailTables> 
             <DetailTables> 
             <telerik:GridTableView HorizontalAlign="Right" DataSourceID="SqlDataSource1">             
              ....             
             </telerik:GridTableView> 
             </DetailTables> 
           ........ 

Thanks
Princy.
0
J
Top achievements
Rank 1
answered on 07 May 2009, 06:02 AM
But doing that puts one of my child tables on the far left, while the second child table is on the far right.

I basically want to position my child tables exactly so that the first child table is positioned under the first column and second table positioned under the 5th column.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 07 May 2009, 06:27 AM
Hi,

In addition to the HoriontalAlign property as suggested by Princy, you can also set the margin of the DetailTables in css styles:
aspx:
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server">             
            <MasterTableView DataSourceID="SqlDataSource1">  
             <DetailTables>  
             <telerik:GridTableView  CssClass="Table1" HorizontalAlign="Left" DataSourceID="SqlDataSource1">  
             .....              
             </telerik:GridTableView>  
             </DetailTables>  
             <DetailTables>  
             <telerik:GridTableView  CssClass="Table2" HorizontalAlign="Right" DataSourceID="SqlDataSource1">              
              ....              
             </telerik:GridTableView>  
             </DetailTables>  
           ........  

css:
 <style type="text/css">  
    .Table1 
    {       
      margin-left:0px;        
    } 
    .Table2 
    { 
        margin-left:35px
    }   
</style>  

Thanks
Shinu.
Tags
Grid
Asked by
J
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
J
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or