G Guest Feb 17, 2004 #1 How do I disable the ability to adjust the row height in a datagrid? I don't see any property that can be set to do this John Suru
How do I disable the ability to adjust the row height in a datagrid? I don't see any property that can be set to do this John Suru
K Ken Tucker [MVP] Feb 17, 2004 #2 Hi, You have to make an new datagrid. Here is an example. Public Class NoResizeDataGrid Inherits DataGrid Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs) Dim hti As DataGrid.HitTestInfo = Me.HitTest(New Point(e.X, e.Y)) If hti.Type = DataGrid.HitTestType.RowResize Then Return 'no baseclass call End If MyBase.OnMouseDown(e) End Sub End Class Ken -------------------- John D Suru said: How do I disable the ability to adjust the row height in a datagrid? I Click to expand... don't see any property that can be set to do this.
Hi, You have to make an new datagrid. Here is an example. Public Class NoResizeDataGrid Inherits DataGrid Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs) Dim hti As DataGrid.HitTestInfo = Me.HitTest(New Point(e.X, e.Y)) If hti.Type = DataGrid.HitTestType.RowResize Then Return 'no baseclass call End If MyBase.OnMouseDown(e) End Sub End Class Ken -------------------- John D Suru said: How do I disable the ability to adjust the row height in a datagrid? I Click to expand... don't see any property that can be set to do this.