DataGrid column Freeze in visual basic.Net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
How can i freeze columns in a datagrid...? I am using a datagrid using data source = an array list which is having DO object.... I want to freeze the columns of datagrid....

tell me the ideas...
regards,
rajamanickam
 
This is not possible by using the default DataGrid. There are some other 3rd
party grid controls who have this kind of functionality.

Here is a nice list of the available controls:
http://www.windowsforms.net/ControlGallery/default.aspx?Category=9&tabindex=
9

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan


rajamanickam said:
Hi,
How can i freeze columns in a datagrid...? I am using a datagrid using
data source = an array list which is having DO object.... I want to freeze
the columns of datagrid....
 
Hi,

You need to create an inherited datagrid contol. Override the
on mouse down event to prevent the user from resizing the column.

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.ColumnResize Then

Return 'no baseclass call

End If

MyBase.OnMouseDown(e)

End Sub



Ken
 
Back
Top