I’m using RadTreeView control for selecting fragments of hierarchical data.
Under some circumstances amount of data is huge so I implemented filtering.
Each time when filtering is performed (TextBox content for filtering is changed) new hirarachical structure is created and assigned to RadTreeView and all items are expanded:
Challenge starts here.
If user selects (checked check box next to one node) several items and do some filtering - if items are not shown their selection is lost.
In order to prevent that I create local structure which holds selected items and method which will reselect desired items once when they became visible.
The question is: when to invoke this method?
If I do it immediately after CourseContentTreeView.ExpandAll();none of items is reselected because their containers are not found by FindContainerByItemId(learningThemeAndObject.Id); which sounds logical because most probably they are not drawn yet.
To overcome this I put RecheckSelectedObjects()call in handler:
This works but only partially. All items are reselected except items from last edge in the tree.
Reason for this is because container for item in last edge is not found in FindContainerByItemId(learningThemeAndObject.Id);
Seems that even event Expanded is fired before containers of items are actually drawn on display.
So my question would be: when to invoke my method RecheckSelectedObjects() and to be sure that all containers are displayed?
Thanks in advance!