Dmcovey1993 Dmcovey1993 - 2 months ago 8
Vb.net Question

vb.net DataGridView column alignment

Here is what is happening I have a DataGridView called

dtgQue
when I go to add columns there are coming in on right side and not on the left where my other two DataGridViews come in is there a setting where I can make it so the columns start on the left like they should be? I am not talking about the text with in the box's. The whole columns start on the right.

Answer

Set the DisplayIndex of your Column.

dtgQue.Columns("MyColumnName").DisplayIndex = 0 'This will set the column at first position

or use like this

myColumn.DisplayIndex = 0

Thus, you can set the order of all columns. You can set this property from design mode also.

EDITED:

if the all columns directions are started from right side then you need to check RightToLeft property. It should be set to No.

Comments