Home Forums WinForms controls Xceed Grid for WinForms How to get a DataBound item from a cell or parentrow

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

    I am evaluating using Xceed Grid instead of the standard DataGrid from Windows.  However, in using the normal Windows DataGrid I am able to do things like this:

      MyDataItem item = (MyDataItem ) MyGrid.Rows[e.RowIndex].DataBoundItem;

     in the Paint and format events.

    Is there anyway to do something like:

       MyDataItem item = (MyDataItem ) e.Cells.ParentRow.DataBoundItem;

     I can’t really find a way to get the databound item from the grid row or cell, so any help would be appreciated.


    Imported from legacy forums. Posted by Josh (had 1151 views)

    User (Old forums)
    Member
    Post count: 23064

    OK I actually solved it:

     MyDataItem item = (MyDataItem)((DataRow) e.Cell.ParentRow).SourceObject;

     in case anybody wanted to know. 

    Imported from legacy forums. Posted by Josh (had 1031 views)

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