Silverlight Binding: User controls inside datagrid.

Posted by Eric on Stack Overflow See other posts from Stack Overflow or by Eric
Published on 2010-04-01T21:23:57Z Indexed on 2010/04/01 21:33 UTC
Read the original article Hit count: 240

Filed under:
|

I have a DataGrid in my silverlight app that has a few columns. A couple basic columns bound with no issues. One column has a UserControl in it and the XAML is as follows:


<data:DataGridTemplateColumn Header="" CanUserSort="True" Width="107">
    <data:DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <local:StaticPageEnlistment EnlistmentName="{Binding SiteName}" Width="400" Height="150"/>
        </DataTemplate>
    </data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>

So I have a public property that's a string called EnlistmentName that I have bound to the SiteName value. I use this same "{Binding SiteName}" in all my other colums with no issues, why can't the user control accept the same binding string?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about databinding