Results 1 to 10 of 10

Thread: datagrid [RESOLVED]

Threaded View

  1. #8
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Then you probably want the DataGrid.CurrentCellChanged event.
    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemwindowsformsdatagridclasscurrentcellchangedtopic.htm

    e.g.:
    Private Sub DataGrid1_CurrentCellChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGrid1.CurrentCellChanged

    Oh and as to:
    Code:
            Dim sFirstCell As String = e.Item.Cells(0).Text 
            Dim sSecondCell As String = e.Item.Cells(1).Text
    based on:
    ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemwindowsformsdatagridclassitemtopic.htm

    it would end up being (at least the way I would do it):
    Code:
            Dim sFirstCell As String = DataGrid1(DataGrid1.CurrentRowIndex, 0)   'cell 0
            Dim sFirstCell As String = DataGrid1(DataGrid1.CurrentRowIndex, 1)   'cell 1
    Last edited by Slow_Learner; Apr 21st, 2003 at 02:29 PM.

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