how to Swap DBgrid columns in runtime

  • Thread starter Thread starter Mat
  • Start date Start date
M

Mat

Please do i swap dbgrid columns in runtime from code?

i want to do the samething like when user move columns
Thanks you
 
Mat,

First, you will have to configure the grid programmatically with
DataGridTableStyle and in turn DataGridColumn styles. See the
"DataGridTableStyle class" topic in MSDN for more details.

Then, to swap columns, you should re-configure the grid with the changed
order in which the columns are added to the DataGridTableStyle.Columns
collection and re-bind the grid to the data source with the SetDataBinding
method.
 
Back
Top