ObjectSharp Blogs

You are currently viewing

Dave Lloyd's 2 Cents

A .NET Developer's Perspective


Getting the DataRow that is bound to an Infragistics UltraGridRow

Here is one of those posts I make because I keep forgetting how to do it. Now that I have posted it I won't forget. Perhaps someone else will be searching for this little code snipit and I will have helped them out. :)

If you have an Infragistics Grid bound to a Dataset, and you want to get the DataRow that the UltraGridRow references. Here is what you do.

Cast the UltraGridRow's ListObject property to a DataRowView and get the DataRow from that.

I'll do the code sample in VB this time.

Dim GridRow As UltraGridRow  'Let's assume you have the GridRow perhaps passed in an event argument
Dim OrderRow As
Myapp.Orders.OrderData.OrderRow

OrderRow = CTypeCType
GridRow.ListObject, DataRowView  ).row , Myapp.Orders.OrderData.OrderRow  )

This will return Null if it's an UltraGridGroupByRow.

Comments

  • dave February 14, 2005 8:03 AM

    Bingo ! Thank you, that's exactly what I was looking for.

  • dave June 19, 2006 12:42 AM

    The type or namespace name 'UltraGridRow' could not be found (are you missing a using directive or an assembly reference?)

  • dave June 19, 2006 5:16 AM

    Great bit of code, up to now I was getting the key from the row doing a select from the datatable . . . . .

  • dave October 29, 2006 12:19 AM

    That has eluded me for days! Thanks.

  • dave October 31, 2006 6:40 PM

    COOL

Leave a Comment

(required) 
(optional)
(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS