G
Guest
H
this is the second time i post a question about the strange behaviour of datagrids in WindowsCF
Using VB.NET i display data of a dataset using a datagrid. From time to time i get an argumentOutOfRangeException in mscorlib, this exception is not cachable into a try and catch block and i can't find an error in my coding.
First time i got it was while trying to change the rowfilter property of the defaultView of my dataTable when the datatable is already set as the datasource of the datagrid. I began creating a new dataview with a different owfilter everytime i needed to change rowfilter, then assigning this new dataview to the datagrid. THis worked
Now when i want to delete a row from the datagrid, i use the delete() of the dataview BUT, in some cases this generates the abouve exception, namely when the datagrid has more than 2 columns and i cick randomly on different cells on different columns. After doing this stupid stick-ballet, i get the error. If i select the rows clicking on the same column, i get no error. Debugging is no help. If i use a breakpoint before the delete() line, comment this line and execute the deleting manually through the commandwindow, the deletion is ok and the dataview.count says i actually erased a row. i think the problem is in the datagrid itself
In the end, i solved this problem too: before deleting the line i set to nothing the datasource of the datagrid and after deleting i put back the dataview. But this behaviour is really stupid !
has some of you some explanation ? is this a bug of the datagrid ?
this is the second time i post a question about the strange behaviour of datagrids in WindowsCF
Using VB.NET i display data of a dataset using a datagrid. From time to time i get an argumentOutOfRangeException in mscorlib, this exception is not cachable into a try and catch block and i can't find an error in my coding.
First time i got it was while trying to change the rowfilter property of the defaultView of my dataTable when the datatable is already set as the datasource of the datagrid. I began creating a new dataview with a different owfilter everytime i needed to change rowfilter, then assigning this new dataview to the datagrid. THis worked
Now when i want to delete a row from the datagrid, i use the delete() of the dataview BUT, in some cases this generates the abouve exception, namely when the datagrid has more than 2 columns and i cick randomly on different cells on different columns. After doing this stupid stick-ballet, i get the error. If i select the rows clicking on the same column, i get no error. Debugging is no help. If i use a breakpoint before the delete() line, comment this line and execute the deleting manually through the commandwindow, the deletion is ok and the dataview.count says i actually erased a row. i think the problem is in the datagrid itself
In the end, i solved this problem too: before deleting the line i set to nothing the datasource of the datagrid and after deleting i put back the dataview. But this behaviour is really stupid !
has some of you some explanation ? is this a bug of the datagrid ?