This question is locked. New answers and comments are not allowed.
Hello,
I'm trying to add a DataTemplate to a cell. Works fine in XAML, but how can I do the same thing in code behind?
This is my XAML example:
I've got problems adding the Stackpanel to the DataTemplate.
Thanks for any help.
Adrian
I'm trying to add a DataTemplate to a cell. Works fine in XAML, but how can I do the same thing in code behind?
This is my XAML example:
<telerikGrid:RadGridView x:Name="gridView" Margin="12,40,12,0" AutoGenerateColumns="False" DataLoadMode="Asynchronous"> <telerikGrid:RadGridView.Columns> <telerikGrid:GridViewColumn Header="user" Width="130"> <telerikGrid:GridViewColumn.CellTemplate> <DataTemplate> <StackPanel Width="auto" Height="25" VerticalAlignment="Center" Orientation="Horizontal"> <TextBlock FontWeight="Bold" Text="{Binding UserName}" x:Name="nameColumn" /> </StackPanel> </DataTemplate> </telerikGrid:GridViewColumn.CellTemplate> </telerikGrid:GridViewColumn> </telerikGrid:RadGridView.Columns></telerikGrid:RadGridView>I've got problems adding the Stackpanel to the DataTemplate.
Thanks for any help.
Adrian