> I bind my datagridview to a dataset returned from a web service:
>
[quoted text clipped - 5 lines]
> criteria (every row whose column has a value of 1).
> So I try: ReportGrid.Rows(i).Visible = False
You should bind the grid to a DataView instead. Like:
[...]
DataView dv = new DataView(ds.Tables[0], "visible = 1", null,
DataViewRowState.CurrentRows);
ReportGrid.DataSource = dv;
[...]
The second parameter to the constructor is the RowFilter.
/B :)
ToyMaker - 24 Aug 2005 14:18 GMT
Thank you very much for your answer.
The point is that I cannot use a dataview. Once I reset the grid's
datasource, I lose a lot of grid formatting - coloring I do after the
binding, depending on the data each row has. Plus the fact that this
formatting takes quite some time (although I am positive my code is
correct, hope it is a beta performance issue).
The only thing that I need is a checkbox to show some rows of the
datagrid or not, just toggle their visibility on-off. I can do it in
all the rows EXCEPT the first one (getting the aforementioned error).
Thank you in advance for any further help.
ToyMaker - 24 Aug 2005 14:40 GMT
Got it.
The currency manager's position is the current datagridview row whose
cell that has focus.
So, I did a ReportGrid.currentCell = ... to a cell whose row is no way
it would hide, and everything worked ok...