[vbnet] Datagrid not modified

Asso79

Active member
Joined
Jun 6, 2003
Messages
35
I should use a datagrid but i dont want to can wirte in datagrid.
I try with the property readonly but so i can use the event dblclick.

Thanks
 
try this code:

Code:
Private Sub DataGrid1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseUp



        Dim pt As New System.Drawing.Point(e.X, e.Y)

        Dim hti As DataGrid.HitTestInfo
        hti = DataGrid1.HitTest(e.X, e.Y)
        If (hti.Type = DataGrid.HitTestType.Cell) Then
            MessageBox.Show(DataGrid1(hti.Row, hti.Column).ToString())

        ElseIf hti.Type = DataGrid.HitTestType.ColumnHeader Then
            MessageBox.Show((DataGrid1.DataSource).Table.Columns(hti.Column).ToString())
        End If


    End Sub

:D
 
Back
Top