How to define a DataTemplate in code?

Posted by Asim Sajjad on Stack Overflow See other posts from Stack Overflow or by Asim Sajjad
Published on 2010-04-10T01:52:48Z Indexed on 2010/04/11 5:53 UTC
Read the original article Hit count: 878

Filed under:
|
|

How can I create dataTemplate in code (using C#) and then add control to that DataTemplate ?

<data:DataGrid.RowDetailsTemplate>
    <DataTemplate>
        <Border>
            <Border Margin="10" Padding="10" BorderBrush="SteelBlue" 
                 BorderThickness="3" CornerRadius="5">
                <TextBlock Text="{Binding Description}" TextWrapping="Wrap" 
                     FontSize="10">
                </TextBlock>
            </Border>
        </Border>
    </DataTemplate>
</data:DataGrid.RowDetailsTemplate>

I am using Sivlerlight.

© Stack Overflow or respective owner

Related posts about silverlight-3.0

Related posts about c#