[英]Silverlight Datagrid how to explicit bind DataGridTextColumn
Setting Binding to EXPLICIT in a textbox can be triggered by calling the following while passing the textbox name: 通过在传递文本框名称时调用以下命令,可以触发在文本框中将绑定设置为EXPLICIT的操作:
private void UpdateBinding(TextBox textBox)
{
BindingExpression be = (textBox).GetBindingExpression(TextBox.TextProperty);
be.UpdateSource();
}
How can I trigger an EXPLICIT binding in a Silverlight DataGrid DataGridTextColumn please? 我如何在Silverlight DataGrid DataGridTextColumn中触发EXPLICIT绑定?
Change your DataGridTextColumn to be a DataGridTemplateColumn with a DataTemplate containing a borderless TextBox. 将您的DataGridTextColumn更改为带有包含无边界TextBox的DataTemplate的DataGridTemplateColumn。
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn>
<DataTemplate>
<TextBox Text="{Binding}" BorderThickness="0" />
</DataTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
I also like to call my UpdateSource using a Behavior as shown here 我也很喜欢使用的行为叫我UpdateSource如图所示这里
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.