I am using Infragistic NetAdvantage 7.1 UltraGrid in WinForm.
Basically, i have a grid column of numeric values and i set the column format to show 3 decimal places.ultraGrid1.DisplayLayout.Bands[0].Columns["Number'].Format = "#,##0.000"
1.1112.2223.333However, i run into scenarios where i need to show 2 decimal places only on the 2nd row (i.e 2.22), but the 1st / 3rd rows should still show 3 decimal places. See below:
1.1112.223.333I look at the UltraGridCell object, and there is no "Format" property at the cell level that overrides theone on Column level. I am not sure how to achieve this one. Could someone please advise? Thanx a lot.
As luck would have it, I recently wrote a sample of this. I've attached it here.
If we have editors setup at UltraGridColumn level. With your example, what is the implication of setting UltraGridCell.Editor to new EditorWithText(). Does the cell-level editor completely replaces the column-level editor? Can a column-level editor be cloned and used at the cell-level as long as they are of type EmbeddableEditorBase?
If you set the Editor on a cell, then the cell will use that editor. The Column's editor is only used if the cell does not already have an editor assigned. This is a common theme throughout the control and in fact, throughout the suite. The more specific setting on the cell overrides and replaces the less specific one on the column, band, or layout.
I'm not sure if editors support ICloneable. But you can easily check to see if the editor has a clone method. I can't see any reason why you would want to clone the editor, though. That doesn't really give you anything, since the editor gets most of it's settings from the owner, anyway. It depends what you are trying to do, though, I guess.
If you are talking about Numeric Formats, then no, there's no other way besides using an editor. But the format itself comes from the owner. In this case, it's the DefaultOwner that you assign when creating the editor. So there's no particular reason why you would need to clone the column's editor.
Thanks Mike. One reason I'm thinking of cloning is we need to change the number format string for certain cells. We can use the same Editor as the one attached to the column. Looking at your example, attaching a cell-level Editor and changing its Format was a solution. Are there others ways to change just the numeric Format string of a cell (same column) without having another Editor attached to that cell?