I get the error "no value at index -1" when I set the datasource to a dataset with no rows int it at run time.
If I set the datasource at design time and the dataset has no rows I get no error.
What gives? How do I get around this?
ADAdministrator Syncfusion Team November 8, 2004 10:35 AM
I don''t see a dropping a GridDataBoundGrid on a Form and using this formload to populate it with a datatable with no rows using 126.96.36.199.
private void Form1_Load(object sender, System.EventArgs e)
DataTable dt = new DataTable("MyTable");
int nCols = 4;
for(int i = 0; i < nCols; i++)
this.gridDataBoundGrid1.EnableAddNew = false;
this.gridDataBoundGrid1.DataSource = dt;
Now if you are trying to reset data into an existing grid, then you may want to try calling:
You can also try this code to make sure there is no currentcell when you reset the data.
grid.Binder.CurrentPosition = -1;
If you can post a sample showing the problem, we can try to suggest something.