Hello,
I have a multicolumn combo box that I can't seem to set the value. When the selectindex is fired for this combobox I do a check of the data the user has worked with. If there is a missing value I pop up a message box which works but i'm unable to reset the selected value to something else. It keeps the selected value the user set to notify the group that they are finished with this job. Since there was an error I want to reset the combobox to a different value. I've tried so many things but nothing seems to work. Here is a few of the things I tried.
I have a multicolumn combo box that I can't seem to set the value. When the selectindex is fired for this combobox I do a check of the data the user has worked with. If there is a missing value I pop up a message box which works but i'm unable to reset the selected value to something else. It keeps the selected value the user set to notify the group that they are finished with this job. Since there was an error I want to reset the combobox to a different value. I've tried so many things but nothing seems to work. Here is a few of the things I tried.
cbStatus.ValueMember =
"value"
;
cbStatus.DataSource = GetStatusCodes();
//Gets data from a data table
cbStatus.AutoSizeDropDownToBestFit =
true
;
//Binding
cbStatus.DataBindings.Clear();
cbStatus.DataBindings.Add(
"SelectedValue"
, bs,
"status"
);
//I've tried all the below code and it doesn't change my combox selected row or value
//((RadGridView)this.cbStatus.EditorControl).Rows[2].IsSelected = true;
//((RadGridView)this.cbStatus.EditorControl).CurrentColumn = ((RadGridView)this.cbStatus.EditorControl).Columns[0];
//((DataTable)bs.DataSource).Rows[bs.Position]["status"] = "02";
///cbStatus.SelectedIndex = 2;
When I add a watch on the below lines I
get
"01"
and
"Complete"
. It should change to
"02"
and
"Working"
((RadGridView)
this
.cbStatus.EditorControl).CurrentRow.Cells[0].Value
"01"
object
{
string
}
((RadGridView)
this
.cbStatus.EditorControl).CurrentRow.Cells[1].Value
"Complete"
object
{
string
}