访问网格内的DataGridTextColumn以更改其内容 [英] Accessing DataGridTextColumn inside a grid to change its content
本文介绍了访问网格内的DataGridTextColumn以更改其内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网格,比如说Grid1.I已经使用
I have a grid, say Grid1.I have created DataGridTextColumns inside the grid dynamically using
DataGridTextColumn textColumn = new DataGridTextColumn();
textColumn.Header = "Marks";
Binding bind = new Binding("Marks");
textColumn.Binding = bind;
Grid1.Columns.Add(textColumn);
然后我分配网格的itemsource。
无论如何访问itmsource以便我可以更改DataGridTextColumn的内容。比如,在分配了itemsource之后,我想在Marks列中用标记+等级(80(A Grade))替换所有标记(比如-80)。那么如何在将每个itemsource列分配给grid之后访问它们?
And then i assign the itemsource of the grid.
Is there anyway of accessing the itmsource so that i can change the content of DataGridTextColumn. Like, after the itemsource has been assigned, i want to replace all marks(say-80) by marks+grades(80(A Grade)) in Marks column. So how do i access each column of itemsource after it has been assigned to grid???
推荐答案
将datagrid corectly绑定到table或observable集合的能力,是否可以更改绑定的基础集合,以更改其值。
The power of corectly binding a datagrid to either a table or observable collection, is that you can change the underlying collection that is binded, to change their values.
这篇关于访问网格内的DataGridTextColumn以更改其内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文