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

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

2 Answers 29 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Murray
Top achievements
Rank 2
Murray asked on 07 Sep 2011, 09:28 PM
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 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 08 Sep 2011, 06:38 AM
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 >>

0
Murray
Top achievements
Rank 2
answered on 08 Sep 2011, 12:51 PM
Thank you Maya!
Tags
GridView
Asked by
Murray
Top achievements
Rank 2
Answers by
Maya
Telerik team
Murray
Top achievements
Rank 2
Share this question
or