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

radgridview common column group headers cutting off

5 Answers 160 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 10 Oct 2013, 09:38 PM
Hi,

We have a situation where the common column group headers are wider than the columns width. See attached image from Telerik demos. In that case, the headers are cutting off. How can we resize the headers so that they are not cut off?

Thanks!

5 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 11 Oct 2013, 07:01 AM
Hello Manoj,

The ColumnGroupHeaders width is the accumulated width of the Headers it contains. this means that resizing the headers will resize the ColumnGroupHeader itself. 

Furthermore, I am not sure I understand you requirement correctly. What exactly do you expect to happen? Can you share a screenshot of the required behavior? 

Thank you in advance! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Manoj
Top achievements
Rank 1
answered on 11 Oct 2013, 05:57 PM
Hi Nik,

Thanks for your response. Please see the attached screenshot. In the Grid.AutoGeneratingColumn event, columns and the GridViewColumnGroups are created (based on some metadata) and added to the RadGridView. Then the width of each column is calculated and assigned. HeaderStyle and assigned to the GridViewColumnGroup.

In some cases, column group header is longer than the combined width of the columns under that group and is being cut off (see screenshot). I'm trying to fix this so that the column group header is not being cut off. Ideally the extra width needed for the column group header should be equally divided among the columns.

So far, I couldn't find a way to fix this using properties or styles or templates for the common column group. So I tried to iterate the VisualTree at runtime to find the common group header label and the width it needs. I could get the CommonColumnHeader list, but the headers do not contain any children.

Any thoughts?

Thanks!
0
Nick
Telerik team
answered on 14 Oct 2013, 08:02 AM
Hi Manoj,

You indicated that the width of the headers is calculated in the AutoGeneratingColumns event. 
Can I suggest using the same event to consider the width of the ColumnGroupHeader and resize the Column Headers accordingly. 

Again, finding the ColumnGroupHeader with the Visual Tree helpers, won't do you any good. As I mentioned before, its width is dictated by the width of the ColumnHeaders, not the other way around.

Hope this makes sense! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Manoj
Top achievements
Rank 1
answered on 15 Oct 2013, 04:24 PM
Hi Nik,

I am trying to do exactly the same thing: In AutoGeneratingColumns event, try to resize the Column Headers so that the ColumnGroupHeader shows up without being cut off. But how do I find out the width needed for the contents of the ColumnGroupHeader? It's not even created yet? The code will be reused in many places and it may should work with different text styles (font size, etc). So I tried to move away from the AutoGeneratingColumns event. Any ideas?
0
Nick
Telerik team
answered on 21 Oct 2013, 06:14 AM
Hello Manoj,

Can't you get it from the ViewModelProperty which is bound to? I suspect you have information about all of the other mentioned properties that have to be considered? Combining those you should be able to determine the width you need for the ColumnGroupHeader, and distribute it among the ColumnHeaders in the same group.

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Manoj
Top achievements
Rank 1
Answers by
Nick
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or