This is a migrated thread and some comments may be shown as answers.

Can we change header text property?

2 Answers 325 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Morteza
Top achievements
Rank 1
Morteza asked on 18 Jul 2012, 11:21 PM
We use drawcolumnheader event in winform listview for changing font and color of column header.
Can we change these property of header of each column in telerik listview?
for example how can I use smaller font  in my header?

2 Answers, 1 is accepted

Sort by
0
Accepted
Morteza
Top achievements
Rank 1
answered on 20 Jul 2012, 12:02 AM
I found answer!
Here said Telerik Presentation Framework  allows to use HTML tags to format the visual elements.
By this point I could change my text size or another text property in column header.
Thank you for your documentation.
0
Stefan
Telerik team
answered on 20 Jul 2012, 01:44 PM
Hello Morteza,

Thank you for writing.

The solution provided in your last post is valid, so I am marking it as answer. Alternatively, you can you the CellFormatting event of the control. Here is a sample:
void radListView1_CellFormatting(object sender, ListViewCellFormattingEventArgs e)
{
    if (e.CellElement is DetailListViewHeaderCellElement)
    {
        e.CellElement.BackColor = Color.Red;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty);
    }
}

More information regarding this matter can be found here: http://www.telerik.com/help/winforms/listview-custom-items.html.

I hope this helps.
 
Kind regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
ListView
Asked by
Morteza
Top achievements
Rank 1
Answers by
Morteza
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or