C Sharp Gridview;不使用循环检索数据 [英] C Sharp Gridview;s retrieve data without using loop
本文介绍了C Sharp Gridview;不使用循环检索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不使用循环的情况下在网格视图中获取最后一行的第一列的数据。任何人都可以帮助我!!!
How can I get data of the first column of the last row in a grid view without using loop. Can anyone help me!!!
推荐答案
使用
ItemContainerGenerator
来获取您的数据的视觉效果。< br $>
to get the Visual of your data.
DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator .ContainerFromItem(this.dataGrid.ItemsSource.OfType<data>().Last());</data>
获得行后,施放
Once you got the Row, cast the
row.Item
到绑定对象(在本例中为Data)并获得所需的值。
希望它有所帮助。
Kannan。 S
to the binded object (In this case it is "Data") and get the desired value.
Hope it helps.
Kannan. S
我已在此处为您解答 - C Sharp Grid视图数据检索 [ ^ ]。
I have already answered you here - C Sharp Grid view data retrieve[^].
这篇关于C Sharp Gridview;不使用循环检索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文