Posted 25 November 2019, 4:13 am EST
hi,
i’m converting my application from the old flexgrid 4.0.20162.188 to the latest 4.0.20193.393 and i’m facing a problem : the ToString() of my cell-object is automatically turned to null.
i found some workarounds but i dont understand if it’s a bug or i’m missing something.
here is my code, reduce to the minimum:
c1FlexGrid1.EmptyAsNull = false;
c1FlexGrid1.Cols[2].Caption = "Ula";
c1FlexGrid1.Cols[2].DataType = typeof(WeightEditorValue); // see workaround #1
c1FlexGrid1.Rows[1][2] = new WeightEditorValue();
if (c1FlexGrid1.Rows[1][2] == null)
MessageBox.Show("is null!");
here is the data class:
public class WeightEditorValue
{
public override string ToString()
{
return "";
//return " "; see workaround #2..
}
}
if i run this code, i get the message box.c1FlexGrid1.Rows[1][2] is null.
if in the ToString() i return “”, it works as i expect.
if i comment the line c1FlexGrid1.Cols[2].DataType = typeof(WeightEditorValue) it workes as expected.
EmptyAsNull… seems have no effect, at least in this case.
anybody can help me to understand what’s the best way to get the previous behaviour?
thanks,
David