Hi all, literally as the title says, I need to change column header(s) during the grid export without changing it on the UI...
I've tried loads of stuff I've found by searching both here and google...
I would have thought something like this would work : -
Private Sub FrameworkGrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles Me.ItemCommand
If e.CommandName.StartsWith("Export") Then
For Each item In Me.Items
If TypeOf item Is GridHeaderItem Then
For Each cell As TableCell In CType(item, GridHeaderItem).Cells
StripTags(cell.Text)
Next
End If
Next
End If
End Sub
But there never is a GridHeaderItem when doing that... It's just all the normal DataGridItems in the grid instead...
Basically, we've appended a load of css styling into some of the column headers and obviously when exporting we want to remove that and put it back to just plain text... I've got a function to strip the HTML using RegEx no problem ('StripTags') but I can't even get it that far...
Any suggestions?
I've tried loads of stuff I've found by searching both here and google...
I would have thought something like this would work : -
Private Sub FrameworkGrid_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles Me.ItemCommand
If e.CommandName.StartsWith("Export") Then
For Each item In Me.Items
If TypeOf item Is GridHeaderItem Then
For Each cell As TableCell In CType(item, GridHeaderItem).Cells
StripTags(cell.Text)
Next
End If
Next
End If
End Sub
But there never is a GridHeaderItem when doing that... It's just all the normal DataGridItems in the grid instead...
Basically, we've appended a load of css styling into some of the column headers and obviously when exporting we want to remove that and put it back to just plain text... I've got a function to strip the HTML using RegEx no problem ('StripTags') but I can't even get it that far...
Any suggestions?