I've got confusion of setting / getting selected indexes of combobox fields inside.
this.Parameter.DataSource = lambdacat.Dict();
{
foreach (DataGridViewRow row in LimView.Rows)
{
//( (ComboBox)row.Cells[1] ) ???
}
}
yes , this doesn't work :)
thank you
You can use
(row.Cells[1] as DataGridViewComboBoxCell).Value == yourvalue;
and get the selected value as
(row.Cells[1] as DataGridViewComboBoxCell).FormattedValue
To set a default selected value
(row.Cells[1] as DataGridViewComboBoxCell).Value =(row.Cells[1] as DataGridViewComboBoxCell).Items[yourneededindex]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With