I have an Ultragrid with Parent/Child rows structure. Is there a way/property such that i can keep some of the child rows expanded even after the parent row is collapsed?
I have a checkbox column for the child rows, when checked, i always want to show that child row even after the parent row is collapsed. So all the other child rows will be collapsed except the one which was checked by user.
Please guide.
Thanks.
Alankar
Hi Alankar,
If a parent row is collapsed, then there is no way to display any of it's descendant.
Maybe instead of collapsing the parent row, you could use a CheckBox or something other state of that row, and hide the unchecked child rows using the Hidden property.
Thanks Mike for getting back.
I tried what you suggested and its now hiding all the unchecked rows.
But the problem is , i have the logic to hide a row (depending upon if the checkbox is checked or not) and then I am cancelling the BeforeRowCollapsed event.
But as the BeforeRowCollapsed event is cancelled, it still shows as expanded: "-" sign in front of Parent row and so there's no way to show again the remaining rows which we are hiding this time. If a user needs to check few more child rows how can we see all the rows without repopulating the grid?
Is there a better place to put this code instead of BeforeRowCollapsed event. As i still want the "+" infront of parent row and below that only those child rows which are checked.
Your suggestion gave a new direction to my thinking for this problem and I really appreciate that.
Hi,
I don't see any way you can do this using the expansion indicator. Maybe what you should do is turn off the expansion indicators completely and then use some other UI, like an unbound boolean column in the grid to determine if the row shows it's child rows or not.
Thanks a lot Mike, I will try that.
Have a good one.