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...
Did you use exactly the same code I did?
In exactly the same event?
Are you sure you incremented the CurrentRowIndex?
My code works fine for me when I used it. So if it's not working for you, then something else is wrong in your code. Maybe you are changing the CurrentRowIndex again in some later event?
i did this. i have added this code in al events. but the grouped header is overriding the first row. i do know how to stop this from happening..
Hi,
Using BeginExport, adding some rows into the Excel Worksheet before the grid exports should be pretty simple.
private void ultraGridExcelExporter1_BeginExport(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.BeginExportEventArgs e) { // Get the current row. WorksheetRow worksheetRow = e.CurrentWorksheet.Rows[e.CurrentRowIndex]; // Write some text into the first two cells of the row. worksheetRow.Cells[e.CurrentColumnIndex].Value = "0, 0"; worksheetRow.Cells[e.CurrentColumnIndex + 1].Value = "1, 0"; // Incrememet the current row index so that the grid export begins after the // text we added above. e.CurrentRowIndex++; }
i have given it in both BeginExport and RowExporting. But still it is not working. is there any event for grouping.?any other option?
The HeaderRowExporting will event will not help you here, because the first row is a GroupByRow, not a Header. Header refers to column or group (not OutlookGroupBy) headers.
HeaderRowExporting will not be fired before the GroupByRow exports.
You need to do this in the BeginExport or maybe the BeforeRowExported event.