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
Thanks for the information Mike,
In the grid the data type for the decimal column is string, however for SortComparer I am using a ComparerClass(implemented by IComparer) which does the sorting considering the datatype as double.
In the initialize layout event for the grid I am saying
band.Columns["date"].Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + " HH:mm:ss.f";
band.Columns["date"].MaskInput = "{LOC}" + CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern + " HH:mm:ss.f";
However for the decimal column I am using like this
band.Columns["decimalcolumn"].Format = ”d”;
Now when I apply the german localization with comma delimiter
Yes I do have InitializeColumn event for the export where doing other which is not related to these two columns.
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.