Skip to content

Getting selected item from DataGridComboBoxColumn C# XAML #21380

Answered by fire-eggs
ivanpbf asked this question in General
Discussion options

You must be logged in to vote

I think this has your answer.

To summarize:

GetCellContent returns the contained control. In the case of DataGridComboBoxColumn, the contained control is derived from ComboBox. I.e:

for (int i =0; i < this.e.Count; i++)
{
    ComboBox ele = DataGridE.Columns[2].GetCellContent(DataGridE.Items[i]) as ComboBox;
    var selectedItem = ele.Text;
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants