Hi,
I have a hierarchical data source, with different hierarchical depth for each parent (or top node).
My problem is that the UltraWebGrid do not show all child levels.
If the first element in the data source has the highest depth, then UltraWebGrid displays the hierarchical correct.
If the first element in the data source has NOT the highest depth, then the UltraWebGrid limit the display of the following parents to the depth of the first element.
So my conclusion is that the UltraWebGrid reads the first element in the data source, to find the depth of the hierarchical structure.
Is this correct? Is there a way for me to configure UltraWebGrid to behave different?
Example
(I have a data source which is date sorted in the select, so I can control which element is the first in the structure)
Correct: If the data source has this structure, everything is displayed fine
parent_1 childLevel_1 childLevel_1 childLevel_2 childLevel_2 childLevel_3
parent_2 childLevel_1 childLevel_1
Fails: If the data source has this structure, some of the child levels are not displayed
parent_1 childLevel_1 childLevel_1
parent_2 childLevel_1 childLevel_1 childLevel_2 (these are not shown in the grid) childLevel_2 (these are not shown in the grid) childLevel_3 (these are not shown in the grid)
I use this "stupid" workaround: I add a dummy structure as the first element of the list. This dummy structure has a depth of 5 children. Then I remove the dummy structure from being displayed...
As long as the list contains a structure with many children as first element, and I do not display this dummy structure, it works...
Here is my some of my code:
...// get activites from DBList<activity> allActivities = ac.getAllActivities(activityQueryHelper);//insert dummy activity with 5 children as first element allActivities.Insert(0, GetDummyActivityWithChilds(activityType)); UWG_Activities.DataSource = allActivities; UWG_Activities.DisplayLayout.ViewType = ViewType.Hierarchical; ....
// this removes the dummy structure from being displayedprivate static void UWG_Activities_InitializeRow(object sender, RowEventArgs e) { if (int.Parse(e.Row.DataKey.ToString()) == _dummyActivityID) e.Row.Delete(); }
private const int _dummyActivityID = -20;
I was running into this issue where i could not see the hierarchy and wa really puzzled that why i dont see all the children, your post helped me figure out the issue.
Did you find any soluton to this problem, i have to show the data in a given order so cannot manipulate the data.
Thanks