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
365
simple column format question
posted

Hi All,

I have a DataSet-bound, web grid that I want to set specific numeric columns to a specific number of decimal places.  Nothing fancy, just set 6 decimals in column A, 3 in column B, etc...

I looked through several posts on this subject and I had thought you just set the all the column .Format properties after I DataBind the grid, ie.

foreach (UltraGridColumn column in TagUltraWebGrid.Columns)
  column.Format = "###0.0";

But that did not make any difference - I still got 4 decimal places.

I also tried to set the column format via the displayLayout band and the result was the same.  Am I missing some overriding setting that prevents Column.Format from working?

Thanks for any advice.

Corey.

Parents
No Data
Reply
  • 365
    posted

    I thought about this some more and I did a search on autogenerated columns and is it true that when you set a DataSource and then DataBind() it, you can't modify the columns after?

    It's strange because I am able to set various things like CellStyle, and HorizontalAlign, etc., and that appears to work, but I can't set the Format.

    I also saw a posting about creating BoundDataFields, but in 2009.1 the UltraWebGrid doesn't appear to support adding these fields to the grid columns collection.

    Any help would be appreciated.

    Thanks!

    Corey.

Children