获取DataGrid值运行时 [英] Get DataGrid Value Runtime
本文介绍了获取DataGrid值运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在WPF中的执行时获取DataGrid单元格值。
实际上问题是我采取的数据网格中的列是字符串而另一列是Combobox我不能得到Combobox值,所以我怎么能得到Combobox值????我想将它存储在一个变量
How can I get DataGrid cell value At Execution Time in WPF.
Actually Problem Is That I Take To Columns in datagrid one is string and another column is Combobox and I cant get Combobox value so how can i get Combobox value???? i want to store it in a variable
推荐答案
试试此链接一个完整的信息如何绑定.........
在运行时创建DataGrid模板列(使用C#)和DataBinding [ ^ ]
try this link a complete information how to bind.........
DataGrid Template Columns creation in Runtime (using C#) and DataBinding[^]
试试这个..
Try this..
string yourvariable = dataGridView1.Rows[1].Cells[1].Value.ToString()//here i assume your combox box is in the second cell of datagrid view You can Change it Like this Cells[0]
这篇关于获取DataGrid值运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文