Split radgridview long header to 2 lines

1 posts, 0 answers
  1. sandy
    sandy avatar
    23 posts
    Member since:
    Aug 2010

    Posted 17 Feb 2012 Link to this post

    Hi ,
    i have a issue.
    am displaying radgridview column headers dynamically from database. Am not decalring any statments to headers.
    this is my rad gridview code.
    <telerik:RadGridView x:Name="rgvMeterReads" ItemsSource="{Binding Data}" HorizontalAlignment="Left" Grid.Column="0" Grid.Row="0" Margin="0,0,0,0" ShowGroupPanel="False" AlternateRowBackground="#CCCC66" AlternationCount="2" ShowColumnHeaders="True" RowIndicatorVisibility="Collapsed" RowHeight="15" Width="1000" Height="650" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserInsertRows="False">
                                <telerik:RadGridView.Resources>
                                    <Style TargetType="telerik:GridViewHeaderCell">
                                        <Setter Property="Background" Value="Transparent"/>
                                        <Setter Property="Foreground" Value="Black" />
                                        <Setter Property="BorderBrush" Value="Blue"/>
                                    </Style>
                                </telerik:RadGridView.Resources>                                
                                <telerik:RadGridView.HeaderRowStyle>
                                    <Style TargetType="telerik:GridViewHeaderRow">
                                        <Setter Property="Background" Value="#66CCFF" />
                                    </Style >
                                    
                                </telerik:RadGridView.HeaderRowStyle>
                                </telerik:RadGridView>

    so how can wrap the header of the radgridview.
    so my prob is some col header names are long and data is less.
    so my clent asks to display the radgridview header in 2 lines.
    here am sending my radgridview header image.
    ex:-
    in header read source is one col header.
    so i have to diaplay read in one line and below on same line source.
    Am tried this  code. but getting wrror in textwrapping property.
    Am tried several ways as mentioned in forum but getting error in textwrapping property.

    <telerik:GridViewDataColumn Width="100" >
        <telerik:GridViewDataColumn.Header>
            <TextBlock Text="Stadium Established Date" TextWrapping="Wrap" />
        </telerik:GridViewDataColumn.Header>
    </telerik:GridViewDataColumn>


    pls help me.
Back to Top