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

Change GroupPanel Text

9 Answers 452 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vance Smith
Top achievements
Rank 1
Vance Smith asked on 05 Jan 2013, 01:30 AM
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

9 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Jan 2013, 07:48 AM
Hi,

Try the following code snippet to achieve your scenario.

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

Hope this helps.

Regards,
Princy.
0
Anton
Telerik team
answered on 09 Jan 2013, 08:58 AM
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.
0
Fariba
Top achievements
Rank 1
answered on 21 Sep 2015, 07:19 AM
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
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Sep 2015, 07:27 AM
Hello ,

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
0
Fariba
Top achievements
Rank 1
answered on 21 Sep 2015, 07:33 AM

Dear dess

yes It works 

Thank You

 

0
Manoj
Top achievements
Rank 1
answered on 14 Jun 2018, 07:11 PM

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

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Jun 2018, 09:16 AM
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.
0
Manoj
Top achievements
Rank 1
answered on 18 Jun 2018, 07:27 PM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jun 2018, 10:40 AM
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.
Tags
GridView
Asked by
Vance Smith
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Anton
Telerik team
Fariba
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or