Thursday, December 24, 2009

How To wrap Text In silverlight DataGrid Column

Make your datagrid AutoGenerateColumns="False" , then do the following changes to wrap text in the datagrid coloumn

<data:DataGridTemplateColumn Header="Your Header" Width="150">
         <data:DataGridTemplateColumn.CellTemplate>
                 <DataTemplate>
                        <TextBlock TextWrapping="Wrap" Text="{Binding Your_Data_Display}" />
                 </DataTemplate>
        </data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>

No comments: