radgridview common column group headers cutting off

6 posts, 0 answers
  1. Manoj
    Manoj avatar
    3 posts
    Member since:
    Oct 2013

    Posted 10 Oct 2013 Link to this post

    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!
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 11 Oct 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Manoj
    Manoj avatar
    3 posts
    Member since:
    Oct 2013

    Posted 11 Oct 2013 Link to this post

    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!
  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 14 Oct 2013 Link to this post

    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 >>
  6. Manoj
    Manoj avatar
    3 posts
    Member since:
    Oct 2013

    Posted 15 Oct 2013 Link to this post

    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?
  7. Nick
    Admin
    Nick avatar
    593 posts

    Posted 21 Oct 2013 Link to this post

    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 >>
Back to Top
DevCraft banner