Interface Ibindinglist : Specified argument was out of the range error
-
Hello I've a puzzle for List; IBindingList and Datagridview guru's I get an unexpected "Specified argument was out of the range" Error Here we are : I have a List of T class I've setted a minimal IBindingList interface So at least : AddNew The List is binded on a DGV The List is EMPTY Path to get the error: 1- Click on the unique and empty first row of the dgv : it trigger an AddNew(no new row in DGV) 2- Edit a cell in that row : it will create an empty new row in the DGV 3- Click on an empty cell in that empty row : it trigger a new AddNew (no new row in DGV) 4- Click on Row 0 again 5- Now if I click back on the second row Row it trigger a third AddNew (no new row in DGV) 6- The click back again on Row 0 : BINGO it crashed ! I cant figure out what really happen ?? But it is clear that at this time the List contains 3 Items and the DGV 2 rows Thanks for any help Error : {"Specified argument was out of the range of valid values.\r\nParameter name: rowIndex"}
-
Hello I've a puzzle for List; IBindingList and Datagridview guru's I get an unexpected "Specified argument was out of the range" Error Here we are : I have a List of T class I've setted a minimal IBindingList interface So at least : AddNew The List is binded on a DGV The List is EMPTY Path to get the error: 1- Click on the unique and empty first row of the dgv : it trigger an AddNew(no new row in DGV) 2- Edit a cell in that row : it will create an empty new row in the DGV 3- Click on an empty cell in that empty row : it trigger a new AddNew (no new row in DGV) 4- Click on Row 0 again 5- Now if I click back on the second row Row it trigger a third AddNew (no new row in DGV) 6- The click back again on Row 0 : BINGO it crashed ! I cant figure out what really happen ?? But it is clear that at this time the List contains 3 Items and the DGV 2 rows Thanks for any help Error : {"Specified argument was out of the range of valid values.\r\nParameter name: rowIndex"}
Hello One more precision It seems that the problem is coming from a wrong on canceledit event handling When I click on a new row on the DGV, it trigger the addnew event but if I leave that row without editing I think it is necessary to remove the new element created ? How can I do that ? Thank you for any help