Home Forums WinForms controls Xceed Grid for WinForms Displaying null values from databound sources Reply To: Displaying null values from databound sources

User (Old forums)
Member
Post count: 23064

I figured it out. This is not about null values. My mistake.

The problem was that Xceed grid in the process of painting a databound cell queries the bound datasource for its value. Now, for a source such as DataTable a DBNull value translates in a TargetInvocationException when read.
The fix consisted in replacing the CellViewManagers with a custom ViewManager which paints the cell differently for the cells bound to a source throwing an exception. This is done by providing a Paint handler which is invoked after the classe’s base Paintbackground() and PaintForeground() have been called so that is the last paint done on the cell.

Imported from legacy forums. Posted by Eugen (had 2993 views)