I have developed some databound grid with a filter bar on it. Everything is ok.
For some reason I need to place the datagrid on a panel. If I do that the Filter bar will not work... I get the following error:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: colIndex
I used the samples to create the filter bar and my code looks like this:
dsStock = new DataSet();
this.Cursor = Cursors.WaitCursor;
this.dgStock.DataSource = dsStock.Tables;
this.dgFilterBar = new GridFilterBar();
this.Cursor = Cursors.Arrow;
The debugger highlights this line when the error strikes:
Again without the panel everything is perfect. The filter bar does the job.
ADAdministrator Syncfusion Team July 6, 2003 11:01 AM
The grid inherits its binding context from its parent so try setting the grid's BindingContext to the BindingContext of the form to see if that makes things work.
this.dgStock.BindingContext = this.BindingContext;