Home › Forums › WPF controls › Xceed DataGrid for WPF › EnsureVisible()
When I change SelectedItem property (in C# code), the scrolling is not adjusted to ensure that selected item is displayed. Is there a EnsureVisible() (WinForm ListView) like method ?
Imported from legacy forums. Posted by Bernard (had 474 views)
I have a DataGridControl bound on a List<> property, named ‘ImportedFunctions’. The property returns a private List<> field.
In C# code, I change the List<> field, and notify the change with OnPropertyChanged(“ImportedFunctions”); The DataGridControl catches the event and updates the rows.
The problem is that SelectedItem keep an old value, aka, a value of previous bound List<>. When the binding source is changed, SelectedItem should not be reset to null ?
Imported from legacy forums. Posted by Bernard (had 702 views)
The “automatic” scrolling behavior is in fact present on the “CurrentItem” property.
You can call the myDataGridControl.BringItemIntoView( myDataGridControl.SelectedItem ) to bring any item into view.
Imported from legacy forums. Posted by Marcus [Xceed] (had 267 views)
I think that it is a best solution to use CurrentItem.
Thank you very much for this quick response.
Imported from legacy forums. Posted by Bernard (had 3753 views)