How to wrap text in header with latest dll's?

3 posts, 0 answers
  1. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 07 Sep 2011 Link to this post

    the property AlignmentContentPresenter has been dropped.

    How do we wrap header test from code behind as my columns are generated and not in the XAML.
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Sep 2011 Link to this post

    Hi Murray,

    You may wrap the text in the header of a column as follows:

    private void clubsGrid_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
            {
                if(e.Column.UniqueName =="Name")
                {
                    TextBlock textBlock = new TextBlock() { Text = "The Header of this column", TextWrapping = TextWrapping.Wrap };
                    e.Column.Header = textBlock;
                }
            }


     

    Kind regards,
    Maya
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
  4. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 08 Sep 2011 Link to this post

    Thank you Maya!
Back to Top