Hi folks,
my first question would be the following. I am trying to Export a Webgrid which is design with multi column headers. Each time the export works fine except the mutli cloumn header wich i added in the webgrid's UWG_InitializeLayout Method the following way.
In the Browser it works fine. But after Export it is invisible.
Dim ch As New Infragistics.WebUI.UltraWebGrid.ColumnHeader(True) ch.Caption = "Employee's Name" ' set the origin to be on the top most level of the header ch.RowLayoutColumnInfo.OriginY = 0 ' extend the newly added header over 3 columns ch.RowLayoutColumnInfo.SpanX = 20 ' add the header into the header layout e.Layout.Bands(0).HeaderLayout.Add(ch)
The current version of the Excel Exporter doesn't support exporting multi-row headers. Unfortunate, I know. But you can manually add the headers to the Excel sheet during the export by using the e.CurrentWorksheet.MergedCellsRegions.Add method in the BeginExport event.
That also means you'll need to come up with some way of saving the info in the multi-row headers. Once you add a header row by using the code you posted, you won't be able to look up that same information during the BeginExport event. You'll have to save that header info in a custom object or some other store and move it to the export event yourself.
Hope that helps,
Mike
But how do you *add* a new header row during the export?
This indeed is C#.
if (e.CurrentWorksheet.Rows.Count() == 1)
for (int cnt = 0; cnt <= cells.Count() - 1; cnt++)
{
childCell = cells.Where(i => i.Value.ToString() == cells[cnt].Value.ToString()).LastOrDefault();
all these are not working for me. if u see in the above if and for conditions rows.count() and cells.count() function is not working. There is no count option after rows and cells.
childCell = cells.Where(i => i.Value.ToString() == cells[cnt].Value.ToString()).LastOrDefault(); - this statement also its not working. what this actually means. from where does that "i" comes from. why it is not working? should i need to add anything. please help me out.
This is LINQ, I am using VS.NEt 2008 , Insetad of looping to match the cell value with the loop's cell value I used this statement:
Count() function on row and cell is also being provided as part of LINQ.
i am using VS.Net 2005...Can you help me out how it can be implemented in VS 2005...
My version is Infragistics 8.2
you are expecting a copy and paste of the code.
You need to loop through Cells and Rows collection. If count is not there may be an alternate to use foreach loop.
Anyways I dont have VS 2005 on my machine and will not be able to help much.
Ok Thank You.
Can you do me one help? i couldn't understand the logic. Please explain me the logic here mainly for HeaderCellExporting and RowExporting event so that i can do it in my code.