4 Answers, 1 is accepted
0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Nov 2012, 11:33 AM
Hello,
If you are using export to pdf for this, you should take a look at this documentation article.
And for your specific case, you can register for the HTMLCellFormatting event and do the following:
If you have any other questions, please let me know.
Best Regards,
Emanuel Varga
WinForms MVP
If you are using export to pdf for this, you should take a look at this documentation article.
And for your specific case, you can register for the HTMLCellFormatting event and do the following:
void
exporter_HTMLCellFormatting(
object
sender, Telerik.WinControls.UI.Export.HTML.HTMLCellFormattingEventArgs e)
{
if
(e.GridCellInfo.Value
is
bool
)
{
var boolValue = (
bool
)e.GridCellInfo.Value;
e.HTMLCellElement.Value = boolValue ?
"+"
:
"-"
;
}
}
If you have any other questions, please let me know.
Best Regards,
Emanuel Varga
WinForms MVP
0
ShareDocs
Top achievements
Rank 1
answered on 14 Nov 2012, 11:46 AM
Hello,
I am using radGridView.PrintPreview function.
In order to use the exporter, I need to export the grid to html file.
Is there another solution for printing other values for boolean columns without saving a file?
Thanks.
I am using radGridView.PrintPreview function.
In order to use the exporter, I need to export the grid to html file.
Is there another solution for printing other values for boolean columns without saving a file?
Thanks.
0
Emanuel Varga
Top achievements
Rank 1
answered on 14 Nov 2012, 12:42 PM
Hello again,
For this you need to register to the PrintCellFormatting event and do the following:
If you have any other questions, please let me know.
Best Regards,
Emanuel Varga
WinForms MVP
For this you need to register to the PrintCellFormatting event and do the following:
private
void
grid_PrintCellFormatting(
object
sender, PrintCellFormattingEventArgs e)
{
if
(e.Column
is
GridViewCheckBoxColumn && e.Row.Cells[e.Column.Index].Value
is
bool
)
{
e.PrintCell.Text = ((
bool
)e.Row.Cells[e.Column.Index].Value) ?
"+"
:
"-"
;
}
}
If you have any other questions, please let me know.
Best Regards,
Emanuel Varga
WinForms MVP
0
Hello guys,
Thank you both for writing.
Lior, Emanuel's solution is the right way to go in this situation. I am marking his post as answer in order to allow other users searching for this information to easily find it. You can read more on customizing the result of printing a grid in our online documentation - RadGridView Printing.
Should you have further questions, do not hesitate to write back.
All the best,
Ivan Petrov
the Telerik team
Thank you both for writing.
Lior, Emanuel's solution is the right way to go in this situation. I am marking his post as answer in order to allow other users searching for this information to easily find it. You can read more on customizing the result of printing a grid in our online documentation - RadGridView Printing.
Should you have further questions, do not hesitate to write back.
All the best,
Ivan Petrov
the Telerik team