emi_sastra
asked on
Allow user to hide and show datagridview columns
Hi All,
How could I achieve it ?
Thank you.
How could I achieve it ?
Thank you.
ASKER
Hi Scott,
How could I save it and restore the latest state of it ?
Thank you.
How could I save it and restore the latest state of it ?
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Scott,
Great. I get some idea.
I will try it.
Thank you very much for your help.
Great. I get some idea.
I will try it.
Thank you very much for your help.
YourDataGridView.Columns(0
You can also refer to the column by the Column Name:
YourDataGridView.Columns("
Note this is the Column Name, which may or may not be the same as the value in the Header Text.
As far as the UI methods used, I've often included a "setup" section where the user could choose which Columns to show or hide. Essentially that was a Checked List Box, or something like that, with the names of the Columns. I check them all by default and allows the user to uncheck them to hide the columns. I often do this on a Tab control, with the grid on the first tab and the Setup stuff on a different tab.