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

[Solved] SelfRefereincing Heirarchial Grid with Inline Editing at Last Level

2 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vishnu Ram Kumar
Top achievements
Rank 1
Vishnu Ram Kumar asked on 23 Feb 2010, 01:58 PM
Hello Telerik

I need to create a Heirarchial Grid for Self Referencing data. The levels of nesting can be more than one.

At the last level of nesting, the Grid should have InLine Editing feature. User can click on any of it's cells and edit it. He should be able to edit as many Cells as he want and finally save the changes in the Database.

I have to add all the controls required for above the task dynamically through the Code Behind. I should not statically define the control in .aspx

Please help.

Thanks in Advance.
Vishnu

2 Answers, 1 is accepted

Sort by
0
Vishnu Ram Kumar
Top achievements
Rank 1
answered on 24 Feb 2010, 09:46 AM
Hi,

I need to generate the controls dynamically because, I have to put this code in SharePoint WebPart as i can not statically define controls there.

I searched the entire demo of Telerik's ASP.NET Ajax Controls but couldn't find anything.

If any of you come across such situation before, please help me.

Thanks,
Vishnu
0
Princy
Top achievements
Rank 2
answered on 24 Feb 2010, 12:47 PM
Hi,

Please take a look at the following link where a working sample has been provided on how to create a self referencing hierarchy grid programmatically.


Here is a sample method on how to set the child items in the edit mode . You can manipulate this to work in your scenario
C#
   protected void RadGrid1_PreRender(object sender, EventArgs e) 
        { 
            foreach (GridDataItem item in RadGrid1.Items) 
            { 
                GridTableView nestedTableView = item.ChildItem.NestedTableViews[0]; 
                foreach (GridDataItem nestedItem in nestedTableView.Items) 
                { 
                    nestedItem.Edit = true
 
                } 
                RadGrid1.Rebind(); 
            } 
        } 


Thanks,
Princy
Tags
Grid
Asked by
Vishnu Ram Kumar
Top achievements
Rank 1
Answers by
Vishnu Ram Kumar
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or