Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have Tried this code but not getting answer in WPF. How to code this in DataGrid of WPF

private void Change(string id, int current)
{
dataGridView.Rows[this.GetRowIndex(id)].Cells[8].Value = (object) current;
}

private int GetRowIndex(string ID)
{
int num = -1;
foreach (DataGridViewRow dataGridViewRow in (IEnumerable) this.dataGridView.Rows)
{
if (dataGridViewRow.Cells[0].Value.Equals((object) ID))
num = dataGridViewRow.Index;
}
return num;
}
What is the alternative code for WPF datagridd?
Posted
Comments
Sergey Alexandrovich Kryukov 29-Sep-14 10:38am    
What are you trying to achieve? This is just a code dump.
—SA
ZurdoDev 29-Sep-14 10:47am    
Let intellisense guide you.

1 solution

WPF uses routed events[^]. The technic of programming is bit different, but you did not specified what kind of issue do you have.
Here is a collection of DataGrid events[^]. I don't see Change event ;(

Please, have a look at similar question: Row click event in WPF datagrid[^]. I hope it help you understand how to catch a "click" event.
 
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