CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: data grid

  1. #1
    Join Date
    Mar 2001
    Posts
    29

    data grid

    How do i retrieve the text of a specific cell in a datagrid. in a flexgrid you do the following:
    text =flxGrid.TextMatrix(1, 17)
    but i cant figure how to do the same in a grid.


  2. #2
    Join Date
    Jun 2001
    Location
    Memphis, TN
    Posts
    146

    Re: data grid

    Option Explicit
    Dim igColumn As Integer
    Dim igRow As Integer
    Dim vargBookmark As Variant

    Private Sub DBGrid1_MouseUp(Button As Integer, Shift As Integer, _
    X As Single, Y As Single)
    igColumn = DBGrid1.ColContaining(X) 'Set the Cell Column number
    igRow = DBGrid1.RowContaining(Y) 'Set the Cell Row number

    vargBookmark = DBGrid1.RowBookmark(igRow) 'Set Bookmark Value

    'Show the contents of the cell in a textbox
    Text1.Text = DBGrid1.Columns(igColumn).CellValue(vargBookmark)

    End Sub


    I just grabbed this off of the MSDN online library. You can check it out at...

    http://support.microsoft.com/support.../0/94.asp?FR=0

    I hope that helps out!


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured