简体   繁体   English

C#WPF MVMVM DataGrid编辑单元格

[英]C# wpf mvvm datagrid edit cells

When I edit a cell, I want to retrieve the content of that cell into a string object in my viewModel? 编辑单元格时,我想将该单元格的内容检索到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. 如果编辑是在datagrid中进行的,那么我们可以使用属性来检索当前单元格中的项目。

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. 让我知道这是否对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM