Autosize Group Descriptor rows

2 posts, 0 answers
  1. Simon
    Simon avatar
    32 posts
    Member since:
    Aug 2011

    Posted 15 Mar 2018 Link to this post

    How do I make the group descriptor rows automatically increase in height so that they display all of the text?

    Note I'm setting the text in the groupSummaryEvaluate event

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3089 posts

    Posted 16 Mar 2018 Link to this post

    Hello, Simon, 

    Thank you for writing.  

    You can set the RadGridView.AutoSizeRows property to true in order to automatically adjust the row's height according. Then, you can subscribe to the ViewCellFormatting event and wrap the cell's text for the group headers:
      
    public RadForm1()
    {
        InitializeComponent();
        this.radGridView1.AutoSizeRows = true;
        this.radGridView1.ViewCellFormatting += radGridView1_ViewCellFormatting;
    }
     
    private void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
    {
        if (e.CellElement is GridGroupContentCellElement)
        {
            e.CellElement.TextWrap = true;
        }
        else
        {
             e.CellElement.ResetValue(LightVisualElement.TextWrapProperty, ValueResetFlags.Local);
        }
    }



    I hope this information helps. Should you have further questions I would be glad to help. 
     
     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top