Home Forums WinForms controls Xceed Grid for WinForms text in numeric field Reply To: text in numeric field

User (Old forums)
Member
Post count: 23064

You can to do something similar with the CellEditorManager.

e.g.:

class MyCellViewerManager : CellViewerManager
{
public MyCellViewerManager()
: base()
{
}

protected override string GetTextCore( object value, CellTextFormatInfo formatInfo, GridElement gridElement )
{
int cellValue = ( Int16 )value;

if( cellValue < 10 )
return “Less then 10”;

if( cellValue > 60 )
return “More then 60”;

return base.GetTextCore( value, formatInfo, gridElement );
}
}

In your code, to use the following class, simply do the following :

gridControl1.Columns[ “NumColumn” ].CellViewerManager = new MyCellViewerManager();

Imported from legacy forums. Posted by André (had 225 views)