Hi
I have a RadGridView bound to a collection and I am adding the columns and their bindings manually in code-behind.
One of the columns has a CellStyleSelector set which is checking the cell value for a negative value (and assigning a style to change the foreground color to red).
This is all working fine when entering values into the grid (positive values are black and negative are red).
However when the grid is initially loaded with data and the columns added, the negative numbers are black.
This is happening because when the style selector is called the first time (after the data has loaded and columns added) the GridViewCell Value property is null.
If I were to then click in a cell to make it go into edit mode and press enter, the style selector is called again - this time with a valid value - and the correct style is applied.
As a test, if I refresh the bindings (notify all properties changed) on a timer after say 1 second, then the style selector is called again with correct values etc.
So my question is: why is GridViewCell Value property null the first time and how can I overcome this?
Thanks,
Mike.
I have a RadGridView bound to a collection and I am adding the columns and their bindings manually in code-behind.
One of the columns has a CellStyleSelector set which is checking the cell value for a negative value (and assigning a style to change the foreground color to red).
This is all working fine when entering values into the grid (positive values are black and negative are red).
However when the grid is initially loaded with data and the columns added, the negative numbers are black.
This is happening because when the style selector is called the first time (after the data has loaded and columns added) the GridViewCell Value property is null.
If I were to then click in a cell to make it go into edit mode and press enter, the style selector is called again - this time with a valid value - and the correct style is applied.
As a test, if I refresh the bindings (notify all properties changed) on a timer after say 1 second, then the style selector is called again with correct values etc.
So my question is: why is GridViewCell Value property null the first time and how can I overcome this?
Thanks,
Mike.