Home Forums WPF controls Xceed DataGrid for WPF EnsureVisible()

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24476 |

    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 ?

    Best regards.

    Imported from legacy forums. Posted by Bernard (had 474 views)

    User (Old forums)
    Member
    Post count: 23064

    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 ?

    Best regards.

    Imported from legacy forums. Posted by Bernard (had 702 views)

    Xceed Support
    Member
    Post count: 5658

    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)

    User (Old forums)
    Member
    Post count: 23064

    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)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.