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

gridclientselectcolumn headertext

7 Answers 410 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 22 Jul 2010, 08:47 PM
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...

7 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Jul 2010, 05:39 AM
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.
0
Bill
Top achievements
Rank 2
answered on 23 Jul 2010, 07:00 PM
That works great - Thanks.
0
Sachidanand
Top achievements
Rank 1
answered on 16 Nov 2011, 07:12 PM
Hi Thanks for the details. Is there a way i can hide the CheckBox at the top & show just the Header text.

Thanks
0
Shinu
Top achievements
Rank 2
answered on 17 Nov 2011, 05:06 AM
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.
0
Andres
Top achievements
Rank 1
answered on 17 Oct 2014, 05:19 PM
Gracias me sirvió tu aporte..!! :D
0
Antonio
Top achievements
Rank 1
answered on 09 Jun 2016, 03:53 PM

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

Thanks

 

0
Eyup
Telerik team
answered on 14 Jun 2016, 11:58 AM
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.
Tags
Grid
Asked by
Bill
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Bill
Top achievements
Rank 2
Sachidanand
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Andres
Top achievements
Rank 1
Antonio
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or