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

[Solved] Removing Header Text from Button Column

3 Answers 111 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raventhorn
Top achievements
Rank 2
Raventhorn asked on 14 Jul 2009, 04:58 AM
My company does not want to have header text on a button column since each button is going to display "Edit" or "Remove". Is there a way to hide this text yet keep the column displayed?

3 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 14 Jul 2009, 06:10 AM
HI,

You may set the HeaderText to Empty as shown below.

ASPX:
 
<telerik:GridButtonColumn HeaderText="" UniqueName="ButtonCol" Text="Click"  ></telerik:GridButtonColumn> 


Thanks
Shinu
0
Accepted
Daniel
Telerik team
answered on 14 Jul 2009, 06:22 AM
Hello Shannon,

I'm not sure that I understand you properly. Why you don't just leave the HeaderText property empty?

A possible approach is to hide the header text on ItemCreated:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    if (e.Item is GridHeaderItem) 
        (e.Item as GridHeaderItem)["myColumn"].Text = "&nbsp;"

or PreRender:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    GridHeaderItem item = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem; 
    item["myColumn"].Text = "&nbsp;"

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Raventhorn
Top achievements
Rank 2
answered on 14 Jul 2009, 03:50 PM
When I did it in the designer it did not show the column but it does now when I did it by hand. Weird.
Tags
Grid
Asked by
Raventhorn
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Daniel
Telerik team
Raventhorn
Top achievements
Rank 2
Share this question
or