GridGroupHeaderItem in a Grid created by code

6 posts, 0 answers
  1. lupotana
    lupotana avatar
    73 posts
    Member since:
    Nov 2006

    Posted 18 Oct 2012 Link to this post

    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 ?

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 18 Oct 2012 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. lupotana
    lupotana avatar
    73 posts
    Member since:
    Nov 2006

    Posted 19 Oct 2012 Link to this post

    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.
  5. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 23 Oct 2012 Link to this post

    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.
  6. lupotana
    lupotana avatar
    73 posts
    Member since:
    Nov 2006

    Posted 26 Oct 2012 Link to this post

    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 :-)


  7. lupotana
    lupotana avatar
    73 posts
    Member since:
    Nov 2006

    Posted 26 Oct 2012 Link to this post

    SOLVED !!!

    GridExpandColumn AND NOT GridGroupSplitterColumn

    void grid_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridExpandColumn)
                e.Column.Visible = false;
        }
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017