Hi, well I don´t know how get value the combobox in my datagrid. I need that when I press the buttonSave, I can get the value of items selected in the combobox.
In XAML I have:
In the xaml.cs :
public class Users
{
public string Id { set; get; }
public string Name { set; get; }
}
List userlist = new List();
for (int j = 0; j < dtUser.Rows.Count; j++)
{
if (dtUser.Rows[j][3].ToString().Trim() != "admin")
{ userlist.Add(new UsuarioAssets { Id = j.ToString(), Name = dtUser.Rows[j][3].ToString() }); }
}
ComboBoxUser.ItemsSource = userlist;
//Note: With this I can see the users en my combobox
private void ButtonSave_Click(object sender, RoutedEventArgs e)
{
// I don´t know how get item selected
}
In internet I read that I get value with Datagrid.Rows but .Rows isn´t in System.Windows.Controls only in System.Windows.Forms
I hope you can help me!
Replies
Know the answer? Post it — somebody with the same question will find it here.