6 Answers, 1 is accepted
0
Richard Slade
Top achievements
Rank 2
answered on 07 Feb 2011, 06:13 PM
Hi Ryno,
You should be able to do this I believe with the ExcelCellFormatting event.
Please can you try the following
let me know if that helps. If not, i'll try and put a full sample together
Richard
You should be able to do this I believe with the ExcelCellFormatting event.
Please can you try the following
AddHandler
export.ExcelCellFormatting,
AddressOf
Export_ExcelCellFormatting
Private
Sub
Export_ExcelCellFormatting(
ByVal
sender
As
Object
,
ByVal
e
As
ExcelCellFormattingEventArgs)
If
e.GridColumnIndex =
Me
.RadGridView1.Columns(
"ColumnName"
).Index
And
e.GridRowIndex > -1
Then
Dim
sb
As
New
System.Text.StringBuilder(
Me
.RadGridView1.Rows(e.GridRowIndex).Cells(e.GridColumnIndex).Value.ToString())
e.ExcelCellElement.Render(sb)
End
If
End
Sub
let me know if that helps. If not, i'll try and put a full sample together
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 07 Feb 2011, 06:20 PM
Hi Ryno,
I'm trying some various tests on this and it seems like this may not be the solution. I'll come back to you as soon as I can.
Richard
I'm trying some various tests on this and it seems like this may not be the solution. I'll come back to you as soon as I can.
Richard
0
Johan
Top achievements
Rank 1
answered on 07 Feb 2011, 06:22 PM
Ah, thanks Richard. I was just busy trying out your first suggestion :-)
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 07 Feb 2011, 06:24 PM
Hi,
Ok, only a slight update. I believe that this will work for you
Hope that helps
Richard
EDIT// Note you might need to handle looking for NULL values too.
R
Ok, only a slight update. I believe that this will work for you
Private
Sub
Export_ExcelCellFormatting(
ByVal
sender
As
Object
,
ByVal
e
As
ExcelCellFormattingEventArgs)
If
e.GridColumnIndex =
Me
.RadGridView1.Columns(
"ColumnName"
).Index
And
e.GridRowIndex > -1
Then
e.ExcelCellElement.Data.DataItem =
Me
.RadGridView1.Rows(e.GridRowIndex).Cells(e.GridColumnIndex).Value.ToString()
End
If
End
Sub
Hope that helps
Richard
EDIT// Note you might need to handle looking for NULL values too.
R
0
Johan
Top achievements
Rank 1
answered on 07 Feb 2011, 06:44 PM
Awesome, that is exactly what I was looking for.
Thanks Richard!
Thanks Richard!
0
Richard Slade
Top achievements
Rank 2
answered on 07 Feb 2011, 07:26 PM
Excellent! Glad that worked for you.