Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataGridView - how freeze a column?

Using DataGridView with VB.Net 2008. I would like to freeze the left column so that when/if scrolled this column still remains in place. can someone tell me how to do this?

like image 665
Alex Avatar asked Dec 14 '09 22:12

Alex


People also ask

How to freeze rows in DataGridView in vb net?

Accomplishing this with the DataGridView control is simple: You just set the Frozen property to true on any row or column to get this behavior. Specifically, if you freeze a column, then that column, and all the columns to the left of it, won't scroll when you scroll to the right in the grid.


1 Answers

  • How to: Freeze Columns in the Windows Forms DataGridView Control:

    To freeze a column programmatically

    Set the DataGridViewColumn.Frozen property to true:

    Me.dataGridView1.Columns("AddToCartButton").Frozen = True
    
  • How to: Freeze Columns in the Windows Forms DataGridView Control Using the Designer:

    To freeze a column using the designer

    1. Click the smart tag glyph on the upper-right corner of the DataGridView control, and then select Edit Columns.
    2. Select a column from the Selected Columns list.
    3. In the Column Properties grid, set the Frozen property to true.
like image 56
Joey Avatar answered Oct 20 '22 02:10

Joey