Home Forums WinForms controls Xceed Grid for WinForms Formatting cell

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #15996 |


    I have an object that has a string property which is bound to a column on my Grid. This string property contains a number of different values, including text, DateTimes, integers and doubles. I need to format differently based on the cell value, so after I have passed my collection to the Bind method I loop through the DataRows and manually set the format specifier on the row’s cell based on the cell value.

    However, the formatting does not seem to get applied no matter what format I set. I have tried to set the FormatProvider also, but it too makes no difference. I have read various forum threads about this, but nothing suggested so far has worked, including this:


    I wonder whether it has something to do with the underlying property type being a ‘string’ that prevents decimal formatting (for example) being applied to the cell’s value? Or maybe, I need to call a refresh style method on the grid once I have updated each cell’s format *after* binding.

    Can anyone please suggest what I can do to get this format working please?



    Imported from legacy forums. Posted by russellcoombes (had 2332 views)

    Xceed Support
    Post count: 5658

    You cannot change the DataType of the cells. The DataType (int, string, DateTime, bool, …) is set when the column is added, but it cannot be changed.

    If all your cells are loaded as “string”, you could assign a different format to the CellViewerManagers (for each type of cells) and each CellEditorManagers.

    Imported from legacy forums. Posted by CharlesB (had 3018 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.