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

Problem with columnspan when hidding columns

1 Answer 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hightow
Top achievements
Rank 1
hightow asked on 16 Aug 2010, 09:15 AM
I have a gridview containing 2 header-rows. The first row (CommonHeader) displays years, the second row (GridViewDataColumn) displays quarters 1 to 4.
Each column in first row is set up with a columnspan of 4 in the xaml, and the appropriate startcolumnindex.
xaml looks something like this:
...
<local:CommonHeader StartColumnIndex="1" ColumnSpan="4" >
<TextBlock Text="2008" />
</
local:CommonHeader>
<local:CommonHeader StartColumnIndex="5" ColumnSpan="4" >
<TextBlock Text="2009" />
</
local:CommonHeader>
...
<telerik:GridViewDataColumn Header="Q1"  />
<telerik:GridViewDataColumn Header="Q2"  />
<telerik:GridViewDataColumn Header="Q3"  />
<telerik:GridViewDataColumn Header="Q4"  />
 
<telerik:GridViewDataColumn Header="Q1"  />
<telerik:GridViewDataColumn Header="Q2"  />
<telerik:GridViewDataColumn Header="Q3"  />
<telerik:GridViewDataColumn Header="Q4"  />
...

In addition I have attached a contextmenu on rightclick on the columns, giving the option to show/hide columns.

The problem with this is the columnspan of the "CommonHeader"-row. Do I have to write code for updating the columnspan when I show/hide columns, or is there a property I can set that fixes this for me.

1 Answer, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 17 Aug 2010, 04:25 PM
Hello Helgrim,

 Yes, you would need to manually update the the ColumnSpan property.

Best wishes,
Yavor Georgiev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
hightow
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Share this question
or