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

Unlimited parent children category with insert/update

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike Nogen
Top achievements
Rank 1
Mike Nogen asked on 06 Jan 2011, 09:09 PM
Hello Rad-Community!

I´m trying to make the Grid support insert/update in a unlimited Category function based on a ID/ParentID structure. It´s very easy to make this work in one level scenario or where you know how deep things will go. It´s also very easy to just show an unlimited level structure WITHOUT insert/update. 

I havent found an example where it shows how this is done in an unlimited nested version.with insert/update function

Is there anyone out there that have made this and are willing to share an example.

/M

1 Answer, 1 is accepted

Sort by
0
Mike Nogen
Top achievements
Rank 1
answered on 09 Jan 2011, 11:11 PM
Found the simple soultion. By just skipping the use of  datasource declaration  

DataSourceID="LinqDataSourceCategories"

 

in the ASPX layer and instead use the OnNeedDataSource event

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
       {
           RadGrid1.DataSource = db.Categories.ToList();
       }

Everthing was working. In my search for this soulution I also found another useful post regarding this that could help others.

http://www.telerik.com/community/forums/aspnet-ajax/grid/unable-to-add-edit-child-elements-in-self-referencing-hierarchy.aspx#963341

/M


 

 

 

Tags
Grid
Asked by
Mike Nogen
Top achievements
Rank 1
Answers by
Mike Nogen
Top achievements
Rank 1
Share this question
or