将文本框绑定到数据表的特定行/列 [英] Bind Textbox to specific row/column of a datatable
本文介绍了将文本框绑定到数据表的特定行/列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
< TextBox Text ={Binding YourTable.Rows [1] [ColumnName]}/>
I have a strongly type Dataset containing a DataTable with a static number of rows. I am trying to bind individual labels and textboxes to certain row/column combinations in the datatable. When I bind directly to the dataTable the textbox does not update. I have tried binding through a CollectionViewSource, but that not only doesn't update, it also doesn't allow me to select the row of the data to which I am trying to bind. What is the best way to bind a textbox to a specific row and column of a DataTable? Specifically I am looking for what I should specify in the XAML as the Source and Path.
解决方案
<TextBox Text="{Binding YourTable.Rows[1][ColumnName]}"/>
这篇关于将文本框绑定到数据表的特定行/列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文