A little bit of background for this one.
I had a Telerik RadGrid that was having few columns ...
It had the column chooser enabled. Few of the columns were icons (for example “Answered”, “Rating”).
I wanted to have them without header text so I added the Template column and everything was just fine.
Until I right clicked on the header in order to show the column chooser. It was displaying the columns with auto generated names like “GridTemplateColumn7”, “GridTemplateColumn10”.
My goal was to keep the header of the grid clean (e.g. no label) because the icons were 16x16 and that’s all the space I needed to occupy with those columns, having a header “Answered” would extend the entire column. So to solve this case here is what I did:
Solution:
1. Added header text to the column and saw that the header text is appearing in the column chooser.
2. To hide it from the header of the column I added an empty <HeaderTemplae>.
The column should look like this:
<telerik:GridTemplateColumn HeaderText="Bookmark">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
</ItemTemplate>
</telerik:GridTemplateColumn>
This would solve the problem for Template columns (and all column types that allow you to define HeaderTemplate). This will not work for GridBoundColumn for example as this type doesn’t have HeaderTemplate.
Hope this helps someone out there …