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?
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.
How to: Freeze Columns in the Windows Forms DataGridView Control:
To freeze a column programmatically
Set the
DataGridViewColumn.Frozen
property totrue
: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
- Click the smart tag glyph on the upper-right corner of the
DataGridView
control, and then select Edit Columns.- Select a column from the Selected Columns list.
- In the Column Properties grid, set the
Frozen
property totrue
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With