Results 1 to 5 of 5

Thread: DevExpress GridControl (How do you get the datarow?)

  1. #1
    DeltaWolf7 is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Jan 2006
    Posts
    47
    Reputation
    110

    DevExpress GridControl (How do you get the datarow?)

    Hi,

    I have just found out about the DevExpress XtraGrid control, thanks to the wonderful review on this site.
    I have been playing now for a few hours and I have managed to fill the gird quite easy, but I cant get the datarow that I have selected.

    How do you get a datarow from a GridControl?


    Thanks

  2. #2
    Neal's Avatar
    Neal is offline VB.NET Forum Admin
    .NET Framework
    .NET 4.5
    Join Date
    Jul 2004
    Location
    Richmond, VA
    Posts
    1,250
    Reputation
    240
    You want to work with the "View" of your Grid, every grid has at least one View. Then you can use the available methods and the current "rowhandle" and work from there. Look at their samples, of which they include many.

    http://www.devexpress.com/Help/Conte...ocument753.htm
    Neal
    VB.NET Forums Admin

  3. #3
    DeltaWolf7 is offline VB.NET Forum Enthusiast
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Jan 2006
    Posts
    47
    Reputation
    110
    Oh god, many thanks. I can't believe I missed those tutorials. Doh!

    I came up with this as a test and it works perfectly.


    Code:
    
    Dim row As System.Data.DataRow = GridView1.GetDataRow(GridView1.FocusedRowHandle)
    MsgBox(row.Item(1))
    

    Thanks

  4. #4
    Neal's Avatar
    Neal is offline VB.NET Forum Admin
    .NET Framework
    .NET 4.5
    Join Date
    Jul 2004
    Location
    Richmond, VA
    Posts
    1,250
    Reputation
    240
    Yep, it's an amazing grid, but with amazing features there comes learning! Also see these:

    http://www.devexpress.com/Products/N...quickstart.xml
    Neal
    VB.NET Forums Admin

  5. #5
    elizas is offline VB.NET Forum Newbie
    .NET Framework
    .NET 2.0
    Join Date
    Jan 2010
    Location
    India
    Posts
    5
    Reputation
    0

    DevExpress GridView: How to get and set the RowHandle

    Cheers,
    Eliza

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking