C# wpf mvvm datagrid edit cells
When I edit a cell, I want to retrieve the content of that cell into 开发者_C百科a string object in my viewModel?
How do I do that?
If the editing is in datagrid than we could retrieve the item in the current cell by using a property.
The property is :
private <YourObject> datagridselectedItem;
public <YourObject> DatagridselectedItem
{
get { return datagridselectedItem; }
set
{
datagridselectedItem = value;
this.RaisePropertyChanged("DatagridselectedItem");
}
}
Let me know whether it is helpful to you.
精彩评论