OK.. I give up.. I can get a basic export working, but I'd like to add a few rows before the export to show Client Name, Job, Address, etc.. 2 hours now and I have nothing working! I've checked the on line examples and they are, to be nice, pathetic...
I assume this is handled on the _BeginExport Method.. Where from there. anything I try using the BeginExportEventAgrs parameter get me nothing...
Also, my formatting of Int columns in my grid is correct (comma where applicible), but these formats DO NOT come over to Excel. Do I have to reformat all my cells?
I like your stuff, but you frustrate the hell out of me..
Thanks...
HI,
I tried adding a header text to the Excel in BeginExport method. But in HeaderRowExporting event, the rowindex becomes 0 and it is overriding the row i added. The same proble in RowExporting event. do i hav to give e.CurrentRowIndex++ in each event??
I would use the BeginExport event. But what you have here will work, also.
I'm surprised it did not work in InitializeColumn.
Using of HeaderCellExporting event helps!
private void ultraGridExcelExporter1_HeaderCellExporting(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.HeaderCellExportingEventArgs e)
{
switch (e.GridHeader.Caption)
case DescOfTableColumns.EncashHistory.BagNumber:
e.GridHeader.Caption = DescOfTableColumns.EncashHistoryUkr.BagNumber;
break;
How can i change ColumnHeader.Caption when i export to Excel?
I wrote this code, but it doesn't work:
private void ultraGridExcelExporter1_InitializeColumn(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.InitializeColumnEventArgs e)
switch (e.Column.Header.Caption)
e.Column.Header.Caption = DescOfTableColumns.EncashHistoryUkr.BagNumber;
case DescOfTableColumns.EncashHistory.Counted:
e.Column.Header.Caption = DescOfTableColumns.EncashHistoryUkr.Counted;
}
Hi Wolfgang,
The grid doesn't really deal directly with the DataSource, it uses interfaces like IBindingList and the notifications from the DotNet BindingManager. I'm pretty sure that there is nothing in place in either of those to notify bound controls that a table has been completely replaced.
So what I would do is set the grid's DataSource to null, and then re-set it to the modified DataSource. That should completely blow away the existing grid layout in favor of the new data structure. If that doesn't work, then you could also try calling grid.DisplayLayout.Reset after setting the DataSource to null.