• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 776
  • Last Modified:

C# WPF Datagrid


I have a WPF application that contains a datagrid. The datagrid is binded to my object "OrderList" (please see the code block below).

I need to know when a user deletes a row in the datagrid. I then intend to move this deleted row to my other List "OrderListFailed" which is bound to a different datagrid.

As always any help would be great.


public class OrderBlock
        public string BlockID { get; set; }
        public int NumFails { get; set; }
        public List<Orders> OrderList { get; set; }
        public List<Orders> OrderListFailed { get; set; }

    public class Orders
        public bool Failed { get; set; }
        public string Name { get; set; }
        public string ID { get; set; }
        public string Side { get; set; }
        public double Amount { get; set; }
        public bool GoodOrder { get; set; }

Open in new window

1 Solution
Bob LearnedCommented:
I haven't done this specifically, but you might want to think about an ObservableCollection, that can detect when an item is removed, and then copy that item to another ObservableCollection for the other grid.

Using the WPF ObservableCollection with EF Entities

protected override void RemoveItem(int index)

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now