[英]How to get selected row values to combo box from data gridview in c#
试试这个。
ar.txtcombo.SelectedIndex = ar.txtcombo.FindString(
this.dataGridView1.CurrentRow.Cells[6].Value.ToString());
我认为这会有所帮助:)
int class= int.Parse(row.Cells[6].Value.ToString());
NameOfYourComboBox.SelectedValue = class;
如果该值不在数据库中,则可以使用此值;
NameOfYourComboBox.Text = row.Cells[6].Value.ToString();
我已经尝试了很多次,并且对WinForms来说效果很好
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.