This is a migrated thread and some comments may be shown as answers.

How to change selected row if another row is selected

1 Answer 77 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 11 Nov 2013, 03:45 PM
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.

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}

1 Answer, 1 is accepted

Sort by
0
Jerry
Top achievements
Rank 1
answered on 12 Nov 2013, 05:04 PM
Can anyone point me in the right direction please?

Within an event called multicolumnComboBox1_SelectedIndexChanged, Can I set the selectedvalue like this
multicolumnComboBox1.SelectedValue = "03";  ?

Thank you
Tags
MultiColumn ComboBox
Asked by
Jerry
Top achievements
Rank 1
Answers by
Jerry
Top achievements
Rank 1
Share this question
or