wpf - Datagridviewcomboboxcolumn getting me mad -


I have a WPF DataGridView that is bound to a source is the source is filled with a dataset database manual

there is a datagridcomboboxcolumn is

I dataset (DSGLAccounts.tables..etc), column name specified before the source of the column to establish displaymemberpath to "ACCOUNT_ID";

And it successfully displays the account list, but when I sellect an item on run time, the cell does not keep it when I go to the other cell just disappears

now I can not figure out how sellected some value to make equals the index based on the dataset that is the source of the grid view (DSRegisters)

I selected index to know that I properties To know about Cursed is how the need for (SelectedItemBinding / SelectedValueBinding / SelectedValuePath)

Here's the form

 snapshot from WPF form here is my idiot code :)

   DataGrid.Columns & gt; DataGridComboBoxColumn Header = "GL Account" width = "*" & Gt; & lt; / DataGridComboBoxColumn & gt; & Lt; DataGridTextColumn header = "description" width = "*" binding = "{binding path = trans_desk, mode = dow}" /> & Lt; DataGridTextColumn header = "debit" width = "*" binding = "{binding path = debit}" /> & Lt; DataGridTextColumn header = "credit" width = "*" binding = "{binding path = credit}" /> & Lt; DataGridTextColumn header = "job" width = "*" /> & Lt; /DataGrid.Columns> & Lt; / Data grid & gt;   

Behind that code

  dgv_Accounts.ItemsSource = DSRegisters.Tables [0] .DefaultView; Data Grid ComboBox Columns COL = ((Datagrid ComboBoxA column) (dgv_Accounts.Columns [0])); COL.ItemsSource = DSGLAccountTables [0] .DefaultView; COL.DisplayMemberPath = "account_id";   

where

DSRegister a dataset record should be displayed on a datagrid DSGLAccounts which leads dataset should be obliged datagridcombobox

Then Also, when I said at run time that when I select a value from the combobox, when I leave the cell, as if it is not editable

I'm noooob in wpf, please help, if any Example or something like this, it would be very useful

selected value The solution to keep - just write something in the code behind it:

  COL.SelectedItemBinding = new binding ("selected item");    

Comments