Custom grouping - two fonts?

3 posts, 0 answers
  1. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 30 Jul 2015 Link to this post

    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. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 31 Jul 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 31 Jul 2015 Link to this post

    Thanks Dess, that worked !
Back to Top