Hello, I am using datagridview and its datasource is a BindingList. But when I try to change the visibility of first row, I am getting InvalidOperationException. How can I change first row's visible value?
Thanks in advance.
Hello, I am using datagridview and its datasource is a BindingList. But when I try to change the visibility of first row, I am getting InvalidOperationException. How can I change first row's visible value?
Thanks in advance.
On prerender, in the web domain, set the visible property.
In windows domain, make sure it is not the header row type. You can't hide that, AFAIK. Otherwise just hide it within the ondatabind.
I found how to do it.
You must specify:
datagridview.CurrentCell = null;
before setting:
row.Visible = false;
because if currentCell is in the row which is wanted to be hide, then mentioned problem occurs.
regards