0

How can i Hide/shows columns in datagridview runtime ?
I have a window application form with a comboBox and a grid.
As according to selection in comboBox Items, I want to hide or show
datagridview columns as according to combobox item selection

2
Contributors
3
Replies
5
Views
8 Years
Discussion Span
Last Post by Ramy Mahrous
0

Dear RamyMahrous
thanks for reply
i have tried the visible property. but my grid is binding grid[ i.e.datasouce] so last columns of grids has been visible false/true
but middle columns are not

so pls guide me. thanks again

0

Look I tried it myself, it works
I dragged and dropped a DataGridView control, I binded it a datasource, then I dragged and dropped a Button, on its ClickEvent handler I wrote this code

dataGridView1.Columns[2].Visible = false;

It removes this column == it works.
Or I don't understand you.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.