User (Old forums)MemberApril 3, 2007 at 10:49 amPost count: 23064
I have an Xceed grid that has two numeric columns as shown below.
As you can in the first row and last row, I would like to display a text i.e. “less than 10” etc.
Is there any way to do that?
I would still want the fields to be numeric, and all numeric values editable. Is there any way to do that?
less than 10
greather than 60
Imported from legacy forums. Posted by userX (had 2800 views)User (Old forums)MemberApril 3, 2007 at 11:46 amPost count: 23064
I was able to do that using the obsolete ICellViewer by implementing the method PaintCellValue, i.e.
public bool PaintCellValue(GridPaintEventArgs e, Cell cell)
e.Graphics.DrawString(“Less than”,cell.Font,Brushes.Black,e.ClientRectangle.X,e.ClientRectangle.Y );
But when I try to do the same thing by inherting from the TextViewer i.e.
protected override void SetControlValueCore(Cell cell)
Control.Text = “Or Greater”;
It doesnt work.
Any help will be appreciated
Imported from legacy forums. Posted by userX (had 286 views)User (Old forums)MemberApril 3, 2007 at 4:06 pmPost count: 23064
You can to do something similar with the CellEditorManager.
class MyCellViewerManager : CellViewerManager
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)
- You must be logged in to reply to this topic.