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

hierarchy grid find/scroll issue

1 Answer 40 Views
GridView
This is a migrated thread and some comments may be shown as answers.
troy
Top achievements
Rank 1
troy asked on 20 Apr 2012, 07:26 PM
I'm building a hierarchial grid using the self reference setting and everything seems to work as I want.  Using the dataloading event, I define the columns and grid properties.  A good example would be an org chart with n levels of employees.  Only the top level employees are displayed and any of them that have direct reports it will show the + to allow you to drill down (I have a filterdescriptor that filters out sub-employees so they are only visible as child records).  My issue is how to implement a Find function.  I have tried to bind the SelectedItem of each grid to a SelectedEmployee notify property.  If I do a find on a top-level employee, it works fine, but if it's a employee in a child grid, it doesn't work (I bound the child grids as (sender as GridViewDataControl).SelectedItem = new Binding("SelectedEmployee")).  If you can help with this, that would be great.  I also will need to auto expand all levels above this in order to display it after the fine.

Any help would be appreciated.

Troy

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 21 Apr 2012, 12:39 PM
Hello Troy,

Generally, the items in the child grids will be loaded once they are expanded. Before that the grid is unaware that they exist, i.e. you cannot find any of the child items until the corresponding grid is visualized. 
If you want the described above functionality, you will need to implement the whole logic on your data level and you will need to have all the items loaded. Once you run through all those items and find the one you want in a child collection, you can find the corresponding data item and expand its row.
However, the exact implementation depends entirely on your specific settings and architecture. 

 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
troy
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or