Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
How to set Cell Text conditionally
posted

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);
      }