Hi Marcelo,
I'm afraid I still don't understand. The thread you are posting on here is about exporting the WinGrid to Excel. Are you doing that? It sounds like maybe you are just writing an Excel Worksheet directly and apply a format to certain cells.
There is no reason I can think of why you should have to double-click anything to get the formatting to appear. Or... are you saying that you are opening up the Excel sheet and applying the formatting manually in Excel instead of in code?
For some cells my CellFormat is "hh:mm-hh:mm-hh:mm-hh:mm" so after export should look like this 00:00-00:00-00:00-00:00. But I've to double clic on the cell(edit mode) to apply the format(it's applied after leave the cell). If I don't, only looks this way 0000000000000000.
I hope you understand what I mean.
I'm afraid I don't understand what you mean. What cell are you double-clicking on? Why do you have to double-click on anything?
Has been a while, but, I've another problem, the FormatString Property worked, but I've to double clic in each cell to apply the format. The problem it's only on Excel, in LibreOffice works fine.
Isn't a method like ApplyFormat?
Thanks
I realized after, here is my code:
private void ExportExcel_CellExported(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.CellExportedEventArgs e) { if (e.GridColumn.Index > 6) { if (Convert.ToInt32(e.GridRow.Cells["IdTipoDato"].Value) == 4) { int excelrow = e.CurrentRowIndex; int excelcol = e.CurrentColumnIndex; e.CurrentWorksheet.Rows[excelrow].Cells[excelcol].CellFormat.FormatString = "hh:mm \"-\" hh:mm \"-\" hh:mm \"-\"hh:mm"; } } }
It worked, my custom format apears in excel as I want but is not working yet.
Anyway thanks a lot, now it's an excel trouble.