I have a datagridview bound to datatable. When the first row in the datagrid is hidden (ie. the scrollbar has moved from the top) and either of the two following program lines is executed, the application crashes
dataTable.Rows.Clear(); dataTable.Clear(); My current solution is to do the following which works as a work around to clear the bound datagridview. int cnt = dataTable.Rows.Count; for(int i=0; i< cnt; i++) dataTable.Rows[0].Delete(); By the way as an experiment I tried the following to move the scrollbar back to the top. I was then going to see if that would make the dataTable.Rows.Clear(); happy. It does if I do it manually. datagridView.Rows[0].Selected = true; datagridView.FirstDisplayedCell = datagridView.CurrentCell; In MS.net this moves the scrollbar to the top. In mono these lines seem to be ignored. -- View this message in context: http://mono.1490590.n4.nabble.com/Clearing-a-datatable-sourced-to-datagridview-crashes-application-tp4501703p4501703.html Sent from the Mono - WinForms mailing list archive at Nabble.com. _______________________________________________ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list