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

RadTreeListView expand rows and set focus on a cell

2 Answers 162 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Manohar
Top achievements
Rank 1
Manohar asked on 07 Feb 2011, 09:06 PM
I have hierarchical data shown on rows and certain cells of the row are editable.

When a cell is modified, the new data (of the cell) triggers some calculations in my application and I want to refresh the control with the new data.
When I am refreshing the control with new data, I want to achieve the following:
1. Expand all the rows that was expanded when the cell data was modified
2. Scroll to the row where the modification happened
3. Set focus to the cell that was modified

Please advise.

Thanks.
B.Manohar

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 11 Feb 2011, 08:53 AM
Hi Manohar,

Generally, if you implement the INotifyPropertyChanged Interface, you do not need to refresh the control so that the changes made are visible. However, I would need a bit more details about you application in order to give more information on the topic. How do you refresh the control ? What field do you want to be recalculated ?
As far as the particular questions are concerned, please find the answers below: 
1. You may use the ExpandHierarchyItem and ExpandAllHirerachyItems methods of the RadTreeListView. Those methods will expand either a particular row or all of them.
2. Once you make the modifications, you need to keep in a variable for example the exact item and call the ScrollIntoView method of the RadTreeListView. The saved item would be the parameter required for the method call.
3. You may use the CurrentCellInfo property of the RadTreeListView and define the cell you want to focus. Afterwards, all you need to do is to call the Focus method for the control:

this.RadTreeListView1.CurrentCellInfo = new GridViewCellInfo(this.RadTreeListView1.Items[5], this.RadTreeListView1.Columns[1]);
this.RadTreeListView1.Focus();

 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Manohar
Top achievements
Rank 1
answered on 15 Feb 2011, 10:44 PM
Hi Maya,
Thank you for your suggestions.
I was able to update the bound in-memory data to make the changes visible.

Thanks.
B.Manohar
Tags
TreeListView
Asked by
Manohar
Top achievements
Rank 1
Answers by
Maya
Telerik team
Manohar
Top achievements
Rank 1
Share this question
or