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
80
UltragridColumn Formatting
posted

Hello All,

i am bind a datatable to ultrawingrid. In that one of the columns is seconds, it shows as 2.6 seconds.

Now my application support localisation. When i use de-DE (german) with ',' (comma) as the delimiter and apply it in the initialize layout of the grid, it does not reflect the comma.

And also i have one more column which is a date format with milli seconds in it. Even this column does not display comma. Now when i export the grid data to an excel, i am able to see the comma, but that is only in the date column.

Now how can i make that comma visible

a. First of all in the grid for the seconds column

b. And also remove the comma when exported to excel.

Please let me know 

 

Bobby

 

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Bobby,

    The format of any particular cell in the grid depends on the DataType, the editor, and the Format property.

    What is the DataType of the column?

    Are you setting Format?

    rac1719 said:
    When i use de-DE (german) with ',' (comma) as the delimiter and apply it in the initialize layout of the grid, it does not reflect the comma.

    I'm not sure I understand you. What exactly are you setting in the InitializeLayout? The current culture? InitializeLayout is much too late to set the the culture for your application. This sort of thing should be done in the Main method of the constructor of the form. Or even the Form_Load. It needs to be established before the controls paint.

     

    The format in Excel once again depends on the Format of the cell and the data type. I don't beleive there is any way to localize a particular Excel file - it uses the current culture of the operating system.

    Excel Formats are not the same as DotNet formats (or at least not always the same). So the WinGrid exporter does not make any attempt to copy the grid column format into Excel. If you want to do this, you should use the InitializeColumn event of the UltraGridExcelExporter.

Children