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

GridGroupHeaderItem in a Grid created by code

5 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
lupotana
Top achievements
Rank 1
lupotana asked on 18 Oct 2012, 04:01 PM
Good morning,
I've a RadGrid object built in a function and after add this grid in the list of controls of the page.

My problem is the GridGroupHeaderItem that is visible.
I try to set the property grid.GroupingEnabled = false; during the creation but don't work.

How cai I do for hide this column in this scenario ?

5 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Oct 2012, 05:22 PM
Hello,

please try with below property.

RadGrid1.ShowGroupPanel = false;

As per my thought you want to hide GroupPanel Let me know if i am not understand your requirement.


Thanks,
Jayesh Goyani
0
lupotana
Top achievements
Rank 1
answered on 19 Oct 2012, 12:29 PM
Yes, yuou understand right but RadGrid1.ShowGroupPanel not work.
I think that is a problem with the new relase of Telerik becouse the last year the same code work well.
0
Eyup
Telerik team
answered on 23 Oct 2012, 11:13 AM
Hello lupotana,

I am afraid we are unable to replicate the issue on our side. Could you please provide us the exact steps to reproduce the problematic behavior locally?

Also, if you are creating your grid programmatically, please verify that you are closely following the tips related to your specific scenario, which are provided in the topic below:
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section4

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
lupotana
Top achievements
Rank 1
answered on 26 Oct 2012, 01:30 PM
Exscuse me for my English.. I explane my problem whith an example...

I create a simple RadGrid in PageLoad and before I add this control to a panel..
protected void Page_Load(object sender, EventArgs e)
    {     
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("CODE", Type.GetType("System.Int32")));
        dt.Columns.Add(new DataColumn("DESCRIPTION", Type.GetType("System.String")));
 
        for (int i = 0; i < 10; i++)
        {
            DataRow dr = dt.NewRow();
            dr["CODE"] = i;
            dr["DESCRIPTION"] = string.Format("DESCRIPTION FOR {0} RECORD", i);
            dt.Rows.Add(dr);
        }
 
        RadGrid grid = new RadGrid();
        grid.DataSource = dt;
        grid.ShowGroupPanel = false;
        grid.DataBind();
        grid.ColumnCreated += new GridColumnCreatedEventHandler(grid_ColumnCreated);
        pnlData.Controls.Add(grid);
    }
 
    void grid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridGroupSplitterColumn)
            e.Column.Visible = false;
    }

In attached  you can see the result in the web form.

My question is : How I hide the GridGroupSplitterColumn ?

In this example I try it in two way :
- Set grid.ShowGroupPanel = false;
- With grid_ColumnCreated event (this way work in RadGrid not generate by code)

Help ?
THhank you :-)


0
lupotana
Top achievements
Rank 1
answered on 26 Oct 2012, 03:10 PM
SOLVED !!!

GridExpandColumn AND NOT GridGroupSplitterColumn

void grid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
    {
        if (e.Column is GridExpandColumn)
            e.Column.Visible = false;
    }
Tags
Grid
Asked by
lupotana
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
lupotana
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or