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

Displaying Two Rows in Each Grid Row

3 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Neil N
Top achievements
Rank 1
Veteran
Iron
Neil N asked on 01 Sep 2008, 04:08 PM
I have a grid with eight bound columns with headers.  In each row, below these columns, I need to add a bound "comment" field  that spans across all eight columns. Will Card View allow me to do this?  Is there an easier way?

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 02 Sep 2008, 06:06 AM
Hello Neil,

A suggestion would be to use the NestedViewTemplate with a label in it, set the HierarchyDefaultExpanded property of the grid to true and then hide the auto-generated GroupExpandColumn. You can refer the code given below to achieve this scenario.
aspx:
<MasterTableView DataSourceID="SqlDataSource1" HierarchyDefaultExpanded="true"   > 
 <NestedViewTemplate> 
            <asp:Label ID="Label1" runat="server" Text="This is a comment"></asp:Label> 
 </NestedViewTemplate> 
 
 <Columns> 
   .... 
 </Columns> 
</MasterTableView> 
 
cs: (to hide the GroupExpandColumn)
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridExpandColumn) 
        { 
            e.Column.Display = false
        }   
    } 

Thanks
Princy.

0
Neil N
Top achievements
Rank 1
Veteran
Iron
answered on 02 Sep 2008, 03:02 PM
Thanks. This worked great except for one cosmetic issue having specifically to do with NestedViewTemplate which I'll create a new thread for.
0
Shinu
Top achievements
Rank 1
answered on 03 Sep 2008, 05:01 AM
Hi Neil,

Go through the following help article which explains how to set styles in a Hierarchical Grid.
Different styles in each hierarchy level with skin applied

Thanks
Shinu.
Tags
Grid
Asked by
Neil N
Top achievements
Rank 1
Veteran
Iron
Answers by
Princy
Top achievements
Rank 1
Neil N
Top achievements
Rank 1
Veteran
Iron
Shinu
Top achievements
Rank 1
Share this question
or