I'm using the UltraWebGrid (8.3) to edit data and have a column with format set as "#,##0.00" to display dollar amounts. On a few of the cells in that column I need to allow whole dollars only. I wanted to override the column format property for those cells to "#,##0" in the InitializeRow method but can't find any format property at the cell level. How would I accomplish this?
Thanks in advance.
Hello,
Yes, this is correct - format is only applicable per Column programmaically and applies for all Cells. However, you can easily change that - just set the Cell.Text property to any format you wish using String.Format (String.Format uses similar format mask syntax as the Column.Format property)
Thanks for your response. But I'm not clear where the best place is to do this. I had thought reading your response that I would put the code in the InitializeRow method. But at that point the text has not yet been formated by the column. I need to change the text in the cell after the column has applied it's format. Is there a method at the row level that is after formatting or do I need to manally reformat each row in the grid's PreRender method? Seems like there should be a better way.
Thanks again.