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

[Solved] DetailTables datasource gets lost

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Beat
Top achievements
Rank 1
Beat asked on 29 Jul 2009, 12:51 AM
hello

i use radgid for organizing my dvd collection. i order them according genre with some infos bout total dvds of this section.
i can break down the parentitem and will see all the dvds belonging to this genre.
through some circumstances i have to bind the datasource from my c# code. i also have to run it every time i change the page. think that is cuz it's all on one page... anyway... for the first page of the grid it's working properly but as soon as i change to page 2 or even further the childgrid shows an empty entry although there should be several entrys.

my code:  (OnPageIndexChanged & OnPageSizeChanged)
  void bindDataSource(object sender, EventArgs e)
  {
      radgridDVD.DataSource = from genres in GenreCollection
                                                select genre;
      radgridDVD.MasterTableView.DetailTables[0].DataSource = DVDCollection;
      rgResultDepositSearch.DataBind();
  }

i ran the application in debug mode and it seams like it goes back to 'select genre' after the childDataSource was bound and the childDataSource gets lost.

and also the pagecount for the detailtable somehow shows the count of the mastertable.

thanks for your help!
beat

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 31 Jul 2009, 02:44 PM
Hi Beat,

Hierarchical grid structure is not supported with simple binding and DataBind() calls. Instead you will need to modify your implementation to wire the DetailTableDataBind event of the grid and bind the nested levels inside its handler. See this online demo for more details on this approach.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Beat
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or