Click here to Skip to main content
15,881,413 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
George Jonsson 9-Sep-14 3:39am    
Normally you delete (or insert, update, etc) in the underlying data source, such as a DataTable.

You need to use DataGrid.SelectedItem Property[^].
 
Share this answer
 
I Solved,

private void dataGrid1_CurrentCellChanged(object sender, EventArgs e)
{
int iRowNum = dataGrid1.CurrentRowIndex;
lblId.Text = dataGrid1[iRowNum, 0].ToString();
}


Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900