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

[Solved] How to Add/Edit rows in Hierarchical RadGrid

1 Answer 181 Views
Grid
This is a migrated thread and some comments may be shown as answers.
satya
Top achievements
Rank 1
satya asked on 20 May 2009, 04:52 PM

Issue1:

I want to add/Edit rows to Hierarchical child grid as how we can done for RadGrid.


Issue2:

 How to add a row by default in insert mode in Hierarchical Grid.?



Regards,
Satya.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 May 2009, 04:35 AM
Hello Satya,

To add rows to your detail table you can set the CommandItemDisplay property for the gridtableview and to edit rows you can use a GridEditCommandColumn in the gridtableview as shown below :
aspx:
 <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" >            
            <MasterTableView DataSourceID="SqlDataSource1" CommandItemDisplay="Top" Name="Master"
                <DetailTables> 
                    <telerik:GridTableView DataSourceID="SqlDataSource2"
                        runat="server" CommandItemDisplay="Top" Name="Detail">               
                                <Columns> 
                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1">                                        
                                    </telerik:GridEditCommandColumn> 

To display the insert row by default in the detail table you can try the following code:
c#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item.OwnerTableView.Name == "Detail"
        { 
            e.Item.OwnerTableView.IsItemInserted = true;      
 
        } 
     } 

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