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

Custom grouping - two fonts?

2 Answers 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lou
Top achievements
Rank 1
Lou asked on 30 Jul 2015, 09:49 PM

I have added custom grouping for my RadGridView. I am setting the text for the group header using the GroupSummaryEvaluate handler, as shown in your documentation here: http://www.telerik.com/help/winforms/gridview-grouping-formatting-group-header-row.html

Question: Can I use two different fonts within my group header text? For example:

 (begin font 1) Description of the group   (begin font2) Number of child rows: 7

     child row 1

     child row 2

     etc. etc. up to child row 7

If so, how can I do that?

-Lou

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 Jul 2015, 07:43 AM
Hello Lou,

Thank you for writing.
 
In order to achieve your goal it is suitable to use the HTML-like Text Formatting functionality which provides an advanced text styling mechanism which can be applied to all Telerik controls for WinForms and their elements, because it enhances one of the smallest element in Telerik Presentation Framework - the text primitive. Here is a sample code snippet which result is illustrated on the attached screenshot:
private void radGridView1_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
{
    e.FormatString = "<html><size=12><font=Verdana>Max Freight = <color= Red><size=11><font=Arial Narrow>{0}";
   
}
 
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridSummaryCellElement)
    {
        e.CellElement.DisableHTMLRendering = false;
    }
    else
    {
        e.CellElement.DisableHTMLRendering = true;
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Lou
Top achievements
Rank 1
answered on 31 Jul 2015, 01:38 PM
Thanks Dess, that worked !
Tags
GridView
Asked by
Lou
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Lou
Top achievements
Rank 1
Share this question
or