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

[Solved] hierarchical dynamic databinding

3 Answers 162 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Henrik
Top achievements
Rank 1
Henrik asked on 03 Jun 2008, 08:44 AM
Hi,

I have a problem finding a solid reusable method to create multilevel hierarchical databinding with ajax radgrid that also allow editing.

All the datasources are built using codesmidth. The solution is a product im continuing for a customer, why the structure with codesmith generation and telerik is fixed.

CodeSmidth builds hierarchical objectdatasources and telerik builds hierarchical grids, but they are not compatible, unfortunately.

So I need to create a codesmidth dynamic bidir datasource and assign this in the needdatasource events, for instance when an expand is clicked. But, but, the arguments for the needdatasource events is quite poor with information, since i cannot determine which level of detailtable is being opened.

Another try was to assign a datasource to the detailtable in the detailtabledatabind event, but here i get the exception "object reference not set..." when it reaches the GetCollectionItemType in the grid.

What can I do ?

Any help is appreciated.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jun 2008, 09:19 AM
Hi Henrik,

Go through the following demo links.

Hierarchy with declarative relations
Hierarchy with DetailTableDataBind event

Princy.
0
Henrik
Top achievements
Rank 1
answered on 04 Jun 2008, 09:48 AM
That are nice demos, but they dont show editing capabilities.

And thats exactly what I have problems with. Do you have demos where editing i detailgrids are working ?

I found one problem though. I didnt have a DataSourceId for the radgrid, but only for the mastertable. Instead I had a databind() in the page_load - if not postback. But the behaviour between the two is very different. Is there an explanation for this.

I have subscribed to this thread but dont get any mails ??

0
Sebastian
Telerik team
answered on 04 Jun 2008, 10:17 AM
Hi Henrik,

Here are a couple of examples which illustrate how to perform editing operations in a hierarchical grid:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/ThreeLevel/DefaultCS.aspx
http://www.telerik.com/community/code-library/submission/b311D-ghdhk.aspx

Additionally, note that simple binding with DataBind() is not supported by RadGrid. You need to utilize NeedDataSource/DetailTableDataBind binding or assign data source control at each level of the hierarchy.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Henrik
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Henrik
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or