gridclientselectcolumn headertext

8 posts, 0 answers
  1. Bill
    Bill avatar
    85 posts
    Member since:
    Oct 2007

    Posted 22 Jul 2010 Link to this post

    Is there a way to get the headertext to be visible in the header of a GridClientSelectColumn?
    I have a customer who insists that "nobody is going to know what it does" if there isn't any text in the header...
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2010 Link to this post

    Hello Bill,

    You can try the following code snippet in ItemDataBound event to set the HeaderText for GridClientSelectColumn.

    ASPX:
    <telerik:GridClientSelectColumn UniqueName="GridClientSelectColumn"></telerik:GridClientSelectColumn>

    C#:
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
           if (e.Item is GridHeaderItem)
            {
                GridHeaderItem headerItem = (GridHeaderItem)e.Item;
                CheckBox chkBox = (CheckBox)headerItem["GridClientSelectColumn"].Controls[0];
                chkBox.Text = "Header Text";
            }
        }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bill
    Bill avatar
    85 posts
    Member since:
    Oct 2007

    Posted 23 Jul 2010 Link to this post

    That works great - Thanks.
  5. Sachidanand
    Sachidanand avatar
    12 posts
    Member since:
    Jun 2011

    Posted 16 Nov 2011 Link to this post

    Hi Thanks for the details. Is there a way i can hide the CheckBox at the top & show just the Header text.

    Thanks
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2011 Link to this post

    Hello Sachidanand,

    Try the following code.
    C#:
    protected void grid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
     if (e.Item is GridHeaderItem)
    {
     GridHeaderItem headerItem = (GridHeaderItem)e.Item;
     CheckBox chkBox = (CheckBox)headerItem["GridClientSelectColumn"].Controls[0];
     chkBox.Visible = false;
    }
    }

    -Shinu.
  7. Andres
    Andres avatar
    1 posts
    Member since:
    Oct 2014

    Posted 17 Oct 2014 in reply to Princy Link to this post

    Gracias me sirvió tu aporte..!! :D
  8. Antonio
    Antonio avatar
    1 posts
    Member since:
    Jul 2010

    Posted 09 Jun in reply to Princy Link to this post

    Hi Thanks for this. My header text do not stay in same checkbox line. Please how a fix it?

    Thanks

     

  9. Eyup
    Admin
    Eyup avatar
    3007 posts

    Posted 14 Jun Link to this post

    Hi Antonio,

    Generally, you can achieve any appearance requirement using CSS. Please let me know which RenderMode and Skin do you use for RadGrid so I can send you a sample runnable web site demonstrating the desired functionality.

    Regards,
    Eyup
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017