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

Simple header colspan

5 Answers 298 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
Fit2Page asked on 09 Nov 2015, 12:23 PM

I am trying to build a Simple (one level) header colspan in which one header should span two columns.

I should I configure MultiColumnHeader to do this?

 

Marc

5 Answers, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 12 Nov 2015, 08:02 AM
Hi Marc,

Please check out the following live example which demonstrates how to use multi column header. I would recommend you to use this approach instead merging a header cells.

Regards,
Kostadin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 12 Nov 2015, 08:37 AM

All examples I can find (also the one you proposed) are with multi-row.

What I want is a simple one row header with a colspan.

Can you please give example for that?

 

Marc

0
Kostadin
Telerik team
answered on 16 Nov 2015, 02:42 PM
Hello Marc,

I am afraid we does not support merging grid cells. The reason is that some of the grid features might not work correctly. For instance, sorting, filtering etc.

Regards,
Kostadin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 17 Nov 2015, 10:18 AM

I meant this:

 

http://d585tldpucybw.cloudfront.net/forums/merging-footer-columns

 ‚Äč

0
Kostadin
Telerik team
answered on 20 Nov 2015, 08:47 AM
Hello,

You can use the approach from the forum and also there is a code library but you should note that we do not support cells merging. Generally you can access the header item by using the GetItems method of the MasterTable view and use ColumnSpan.
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    GridHeaderItem header = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
    header["FirstColumnUniqueName"].ColumnSpan = 2;
    header["SecondColumnUniqueName"].Visible = false;
}

Nevertheless, as I already mentioned many of the built-in features might not work correctly when using this approach.

Regards,
Kostadin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Kostadin
Telerik team
Fit2Page
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or