Home Forums WPF controls Xceed DataGrid for WPF How to get the current item from DataRow object

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

    Hi,

    I have a DataRow object in my code and I need to be able to get the corresponding object from the ItemsSource (DataGridCollectionView collection).

    The DataRow has come from a DoubleClick event and the cells contain the correct data for the row that was double-clicked, however I can’t find how to get the underlying data object from the ItemsSource.

    I’ve looked for index, item, current item, selected item, parent item, etc properties but can’t find any on the DataRow object. Is there any way to get to the underlying object from the DataGridCollectionView collection?

    Thanks in advance for any help.

    Cheers,
    Terry.

    Imported from legacy forums. Posted by Terry (had 2641 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry for the waste of time… I’ve just found out that it is in the DataContext property of the DataRow.

    Cheers,
    Terry.

    Imported from legacy forums. Posted by Terry (had 448 views)

    Xceed Support
    Member
    Post count: 5658

    You can also use the DataGridControl.GetItemFromContainer() method to obtain the data item from a DataRow.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 3418 views)

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