Change GroupPanel Text

10 posts, 0 answers
  1. Vance Smith
    Vance Smith avatar
    38 posts
    Member since:
    Jun 2012

    Posted 04 Jan 2013 Link to this post

    Hi,

    I would like to change the GroupPanel Text. Currently it says, "Drag a column here to group by that column.". I would like it to say something else.

    Can someone please assist.

    Thanks,

    Vance
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 07 Jan 2013 Link to this post

    Hi,

    Try the following code snippet to achieve your scenario.

    C#:
    this.radGridView1.TableElement.GridViewElement.GroupPanelElement.Text = "some text";

    Hope this helps.

    Regards,
    Princy.
  3. Anton
    Admin
    Anton avatar
    167 posts

    Posted 09 Jan 2013 Link to this post

    Hello Vance,

    Thank you Princy for provided help.

    The provided code is correct. Just for your information, the GridViewElement can be accessed directly through the control as well:
    this.radGridView1.GridViewElement.GroupPanelElement.Text = "Your Custom text 1";

    Also, you need to handle the case when user clears the groups, because the grid will reset the text to the default one. This can be achieved by subscribing to the GroupByChanged event:
    void radGridView1_GroupByChanged(object sender, GridViewCollectionChangedEventArgs e)
    {
        if (e.GridViewTemplate.GroupDescriptors.Count == 0)
        {
            this.radGridView1.GridViewElement.GroupPanelElement.Text = "Your Custom text 1";
        }
    }

    This topic is also discussed in the following forum thread: http://www.telerik.com/community/forums/winforms/gridview/radgridlocalizationprovider-custom-groupingpaneldefaultmessage.aspx

    I hope this helps.

    All the best,
    Anton
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  4. Fariba
    Fariba avatar
    24 posts
    Member since:
    May 2014

    Posted 21 Sep 2015 Link to this post

    Hi
    I want to change the height of  GroupPanelElement by changing the height value in
       this.radGridView1.GridViewElement.GroupPanelElement.Size = new Size(this.radGridView1.Width, 200);
    nothing would be happened and value came back to 23 which is set for it as a default value​.
    What should I do?

    Best regards,
    Faqriba
  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4120 posts

    Posted 21 Sep 2015 Link to this post

    Hello Faqriba,

    Thank you for writing.
     
    Instead of setting the Size property, you can set the MinSize property to increase the group panel's height:
    this.radGridView1.GridViewElement.GroupPanelElement.MinSize = new Size(this.radGridView1.Width, 200);

    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
  6. Fariba
    Fariba avatar
    24 posts
    Member since:
    May 2014

    Posted 21 Sep 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Dear dess

    yes It works 

    Thank You

     

  7. Manoj
    Manoj avatar
    5 posts
    Member since:
    Jun 2018

    Posted 14 Jun 2018 Link to this post

    So this works.

    DGVToolNotes.GridViewElement.GroupPanelElement.MinSize = new Size(DGVToolNotes.Width, 50);

    But I can't seem to get this to work below.

    this.DGVToolNotes.GridViewElement.GroupPanelElement.Text = "test this string";

            private void DGVToolNotes_GroupByChanged(object sender, GridViewCollectionChangedEventArgs e)
            {
                if (e.GridViewTemplate.GroupDescriptors.Count == 0)
                {
                    this.DGVToolNotes.GridViewElement.GroupPanelElement.Text = "testing this shit";
                }
            }

    Also, anyone know how to change the Font of this string?

    MG

     

  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4120 posts

    Posted 15 Jun 2018 Link to this post

    Hello, Manoj,  

    Note that by default the group panel will show the specified text only when no grouping is available. Once you group the grid, the text is hidden. I suppose that you set the GridViewElement.GroupPanelElement.Text property in the form's constructor. If you set it in the Load event, the desired text will be displayed. As to the font, it is necessary to set just the GroupPanelElement.Font property: 
    private void RadForm1_Load(object sender, EventArgs e)
    {
        this.radGridView1.GridViewElement.GroupPanelElement.Text = "test this string";
        this.radGridView1.GridViewElement.GroupPanelElement.Font = new Font("Arial", 12f, FontStyle.Italic);
    }




    I hope this information helps. If you have any additional questions, please let me know. 

    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.
  9. Manoj
    Manoj avatar
    5 posts
    Member since:
    Jun 2018

    Posted 18 Jun 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    HI Dess,

    this worked half way. GroupPanelElement.Font worked, but the GroupPanelElement.Text didn't.

    Strange. See screen cap attached.

    private void newTablePanel_Load(object sender, EventArgs e)
    {
        this.myDataTable.GridViewElement.GroupPanelElement.Text = "test this string";
        this.myDataTable.GridViewElement.GroupPanelElement.Font = new Font("Calibri", 30f, FontStyle.Italic | FontStyle.Bold | FontStyle.Underline);
    }

     

    MG

  10. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4120 posts

    Posted 19 Jun 2018 Link to this post

    Hello, Manoj,  

    If you set the GroupPanelElement.Text property in the Form.Load event it is supposed to work as expected. I have attached my sample project for your reference. If you are still experiencing any further difficulties, feel free to modify the project in a way to reproduce the experienced issue and get back to me with it so I can investigate the precise case. Thank you in advance. 

    I hope this information helps. If you have any additional questions, please let me know. 

    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