Jerry Kurata
Top achievements
Rank 1
Jerry Kurata
asked on 08 Jul 2010, 05:33 PM
Hi,
We have a requirement to allow users to change the column header formatting and text at runtime. Changing the text appears easy enough, but I am not sure how to change the formatting. Users need to be able to set the Font Family, size, bold, italics, underline and color for the Column header. Do you have a sample showing this?
Thanks,
Jerry
We have a requirement to allow users to change the column header formatting and text at runtime. Changing the text appears easy enough, but I am not sure how to change the formatting. Users need to be able to set the Font Family, size, bold, italics, underline and color for the Column header. Do you have a sample showing this?
Thanks,
Jerry
5 Answers, 1 is accepted
0
Accepted
Hello Jerry Kurata,
Kind regards,
Yavor Georgiev
the Telerik team
You can insert a TextBlock in the column's header and bind its various properties.
<
telerik:GridViewColumn
>
<
telerik:GridViewColumn.Header
>
<
TextBlock
Text
=
"{Binding HeaderText}"
FontFamily
=
"{Binding HeaderFont}"
/>
</
telerik:GridViewColumn.Header
>
</
telerik:GridViewColumn
>
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jerry Kurata
Top achievements
Rank 1
answered on 08 Jul 2010, 07:15 PM
Thanks. That did the trick!
0
Jerry Kurata
Top achievements
Rank 1
answered on 13 Jul 2010, 09:05 PM
Hi,
This change created a problem with exporting the data to excel, word, etc. All column title appears as the "windows. ... TextBox".
How can I fix this?
Thanks,
Jerry
This change created a problem with exporting the data to excel, word, etc. All column title appears as the "windows. ... TextBox".
How can I fix this?
Thanks,
Jerry
0
Accepted
Hello Jerry Kurata,
Greetings,
Yavor Georgiev
the Telerik team
You need to handle the ElementExporting event of the RadGridView:
private
void
radGridView1_ElementExporting(
object
sender, GridViewElementExportingEventArgs e)
{
if
(e.Element == ExportElement.HeaderCell)
{
if
(e.Value
is
TextBox)
{
e.Value = (e.Value
as
TextBox).Text;
}
}
}
Yavor Georgiev
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Jerry Kurata
Top achievements
Rank 1
answered on 16 Jul 2010, 05:38 PM
Thanks! That fixed the problem.