如何从智能项目中的数据网格中获取选定的id值 [英] How to get selected id value from data grid in smart project
本文介绍了如何从智能项目中的数据网格中获取选定的id值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我开发了一个带有插入的Windows应用程序,使用sdf数据库选择操作(Windows Mobile CE)
我使用了datagrid,并且我将数据绑定到它。
我想获得选择的id值。
但是没有像SelectedRow.cells [0]这样的属性。
我想要删除使用id选择记录。
我该怎么办?
请帮助我。
谢谢
I have developed a windows application with insert, select operation using sdf database (Windows Mobile CE)
I have used datagrid, and i bind data to it.
I want to get selected id value.
But there is no any property like SelectedRow.cells[0].
I want to delete selected record by using id.
How do i do ?
Please help me.
Thanks
推荐答案
你需要使用 DataGrid.SelectedItem Property [ ^ ]。
I Solved,
private void dataGrid1_CurrentCellChanged(object sender,EventArgs e)
{
int iRow Num = dataGrid1.CurrentRowIndex;
lblId.Text = dataGrid1 [iRowNum,0] .ToString();
}
谢谢
I Solved,
private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
{
int iRowNum = dataGrid1.CurrentRowIndex;
lblId.Text = dataGrid1[iRowNum, 0].ToString();
}
Thanks
这篇关于如何从智能项目中的数据网格中获取选定的id值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文