Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I develop a WPF application in C # and use EntityFramework. I have a GridView component (which name is dgv_name) and I want to select several lines, then I want to update State column after clicking the btn_Void. The GridView contains three coulmnns which are:

ID (int)
Name (string (MaxLength 50))
State (boolean)
I want to change value of State from true to false for all the selected lines when I click the btn_void. My code:

What I have tried:

C#
private void btn_Void_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
    { 
      foreach (DataGridCellInfo cell in dgv_name.SelectedItems)
        {
            //I dont know what code should i write
        }
    }
Posted
Updated 6-Jun-17 6:59am

1 solution

WPF works a bit differently than Win Forms, you can use an ObservableCollection for this purpose, see: How to: Create and Bind to an ObservableCollection[^]
Example: WPF Tutorial: ObservableCollection Example WPF[^]
 
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