Which XAML fragment should you use?

You are developing a lineof-business application by using Silverlight 4. The application will be used for data entry and reporting purposes. You need to implement a DataGrid control that will allow editing of bound data. Which XAML fragment should you use?

You are developing a lineof-business application by using Silverlight 4. The application will be used for data entry and reporting purposes. You need to implement a DataGrid control that will allow editing of bound data. Which XAML fragment should you use?

A.
<grid:DataGridTemplateColumn Header=”Supplier”>
<grid:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text=”{Binding Path=Supplier}” />
</DataTemplate>
</grid:DataGridTemplateColumn.CellTemplate>
</grid:DataGridTemplateColumn>

B.
<grid:DataGridTemplateColumn Header=”Supplier”>
<grid:DataGridTemplateColumn.CellStyle>
<Style TargetType=”grid:DataGridTemplateColumn”>
<Setter Value=”Template” Property=”EditTemplate” />
</Style>
</grid:DataGridTemplateColumn.CellStyle>
</grid:DataGridTemplateColumn>

C.
<grid:DataGridTemplateColumn Header=”Supplier”>
<grid:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text=”{Binding Path=Supplier}” />
</DataTemplate>
</grid:DataGridTemplateColumn.CellTemplate>
</grid:DataGridTemplateColumn>

D.
<grid:DataGridTemplateColumn Header=”Supplier”>
<grid:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text=”{Binding Path=Supplier}” />
</DataTemplate>
</grid:DataGridTemplateColumn.CellTemplate>
<grid:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text=”{Binding Path=Supplier}”/>
</DataTemplate>
</grid:DataGridTemplateColumn.CellEditingTemplate>
</grid:DataGridTemplateColumn>



Leave a Reply 0

Your email address will not be published. Required fields are marked *