Question

I don't know how to hide column in datagrid in designer. Could anyone help me? I know that I can do it from code, but is it possible without code behind?

I already try with TableStyles but it doesn't work.

Here is my datagrid configuration: http://i.stack.imgur.com/pzSRe.png and my BindingSource http://i.stack.imgur.com/uh8bG.png

What I am doing wrong?

Thanks, Marek

Was it helpful?

Solution

Try this in designer:

  • If you want to toggle between hiding a column and showing a column at design time, you only need to add the DataGridTableStyle once.

  • To show the column, set the Width property of GridColumnsStyles to a nonzero value. for example:

    DataGrid1.TableStyles("Products").GridColumnStyles("Quantity").Width = 100

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top