I have a DataGridView object, the columns of which I am re-arranging by assigning them particular values for their DisplayIndex properties like so:
grdMain.Columns["BarcodeNumber"].DisplayIndex = 0;
grdMain.Columns["Type"].DisplayIndex = 1;
grdMain.Columns["Title"].DisplayIndex = 2;
grdMain.Columns["ParentID"].DisplayIndex = 3;
I am re-arranging the columns this way after I have populated the DGV object.
My question is this:
If I start with, for example, the grdMain.Columns["BarcodeNumber"] column being being the fifth column in the grid (index of 4), and then re-assign that column's DisplayIndex property to be 0, which of the following will correctly access the value of the BarcodeColumn:
grdMain.Columns[0]
or
grdMain.Columns[4]
Does altering the DisplayIndex for a DGV column affect its actual index on the grid?
Thanks!