Is there any way of cloning a DataGridViewColumn object, including the data and styling (basically, everything about the column). I’d like to move a column by copying it into memory, removing it from the grid, then re-inserting it somewhere else – as far as I know, this is the only way of moving a column and preserving a sequential Index property. If I move a column I have to use DisplayIndex, which is considerably more awkward to process.
ChatGPT has given me some code to do it but it’s long-winded and I’m not sure if it’s missing anything.
Hi Neil,
Sorry for the delay!
The easiest thing you can do is just remove the column from a Grid and then just add it to another!
I’ll prepare a sample for you shortly!
Best,
Alaa
Please login first to submit.