Home › Forums › WinForms controls › Xceed Grid for WinForms › Removing a DataRow from a Grid throws a "Object reference not set to an instance of an object." exception. › Reply To: Removing a DataRow from a Grid throws a "Object reference not set to an instance of an object." exception.
Finally I found the problem. It turned out that somewhere after deleting the row, in a “RefreshUI” method, I was setting the grid.CurrentRow to null (don’t ask me why, I think I made a confusion to GridControl.SelectedRows or such) but this assignment is not allowed by the GridControl framework. Maybe if an exception will be thrown when trying to assign null to CurrentRow will make the programmer life easier (less error-prone)? 🙂
Imported from legacy forums. Posted by bogdip (had 558 views)