开发者

C# wpf mvvm datagrid edit cells

开发者 https://www.devze.com 2023-03-05 13:36 出处:网络
When I edit a cell, I want to retrieve the content of that cell into 开发者_C百科a string object in my viewModel?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消