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

Empty child tables when HierarchyDefaultExpanded=true

3 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan Pettersson
Top achievements
Rank 1
Dan Pettersson asked on 15 Sep 2009, 07:00 AM
I have created a hierarchical grid with one sublevel. I want all the child tables visible from start so I've set the

HierarchyDefaultExpanded = true.

When I do this, all the items are expanded but the child tables are empty. Not even the "No child records to display" is there, it's just plain empty.

If I remove the HierarchyDefaultExpanded = true it works as expected, I can manually expand each item of the mastertable, and the child records will display.

Does anyone know what more steps I have to take to have all subtables displayed with data on page load?

 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 Sep 2009, 08:08 AM
Hi Dan,

I tried with the HierarchyDefaultExpanded property and the detail tables are shown as expected. I am not sure about what is happening on your end. Are you binding the Grid using AdvanceDataBinding techniques? Because hierarchical grid structure is not supported with simple data-binding (calling DataBind()).
Advanced Data Binding

Thanks
Princy
0
Dan Pettersson
Top achievements
Rank 1
answered on 15 Sep 2009, 01:00 PM
Yes, the grid is bound through the NeedDataSource-event...
0
Dan Pettersson
Top achievements
Rank 1
answered on 24 Sep 2009, 08:10 AM
Found the error when working with a different grid.

The situation that gave me the error was that I bound the mastertableview through the NeedDataSource-event and the detailtables through an ObjectDataSource.

Changing so that both of them uses ObjectDataSource made the

HierarchyDefaultExpanded=true

work.
Tags
Grid
Asked by
Dan Pettersson
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Dan Pettersson
Top achievements
Rank 1
Share this question
or