Guys, can this be done:
I have some special functionality needed behind cells in a particular col. I think I need to build a custom cell derived from UltrGridCell and assign that as the celltype on a given column. I don't want to go as far as building a whole new CellEditor, implementing interfaces and all. Just some extra functionality behind the loading of data and entering/clicking into the cell... I do realize this might not be a trivial pursuit.
As tha data is loaded (in this case manually and not bound), I'd like to set custom properties on a cell.
eg: ultraGrid1.Rows[3].Cells[3].SpecialProperty = "special value";
As the user double-clicks or presses return in a given cell, call some custom method.
eg: ultraGrid1.ActiveCell.SpecialMethod("input");
Maybe doing things in the AfterCellActivate event or ClickCell, DoubleClickCell and KeyDown events...
Any advice would be great.
Thanks
It is not possible to replace the UltraGridCell with a custom cell object.
You may be able to acheive what you want in some other way, by handling events of the grid. But it's hard to say exactly without knowing what you want to do.
Extension methods (as jct suggests) could certainly be useful here, as could the Tag property of the cell.
I think replacing the cell could be very complicated if possible.
You can achieve that in other ways.
To store custom data for each cell you can use the cell.Tag property.
To add functionallity you can use extension method like:
public static class CellExtension
{
public static void SpecialMethod(this UltraGridCell cell, string input)
cell.Tag.....
}