Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
Get underlying object from Active Row
posted

I have a XamDataGrid bound to an observable collection of "MyObjects".  How do I get the "MyObject" instance from the ActiveRow?  When I look at the selection changed and record activated events all I see are Record objects.

I'm sure this is something silly but I can't see how to do it.  Do I need to just brute force it by getting the index of the active record and using that index back into my original collection to which the grid was bound?

 Thanks for your help,

Mike

Parents
  • 54937
    Offline posted

    The underlying object is represented by a DataRecord (a derived Record) so as long as the ActiveRow is a DataRecord (and not a GroupByRecord, etc.), you can upcast to that type and then access its DataItem property to get at the underlying list object.

Reply Children
No Data