I have an UltraGrid bound to a list of elements.
One of the columns is of type double.
I want to conditionally calculate a text string based on user picking this else where:
But cell.Text is readonly
and
cell.Value throws an exception, because it wont let me set a string into a double columns value.
How can I do this?
private void fGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { UltraGridCell cell = e.Row.Cells["ColName"];
cell.Text = DollarFormatting.FormatDollarValue((double)value, DollarsOrPercentage.Percentage, TotalForPercentage); }
I could be wrong - but I think.....
You want to set the value in the cell using .Value not with .Text.
e.Rows.Cells["ColName"].Value = whatever
The error you are getting makes sense; you should assign a double into a column that is expecting a double. The formating you want to do shouldn't be done using a string; instead you should be using an input mask.
The formatting I needto do requires a conditional mathematica operation.