This question is locked. New answers and comments are not allowed.
Hello!
I'm having a strange issue in my application. My scenario is as follows:
1. I have a simple form, with a RadComboBox and a TextBox;
2. I have a custom object (say myObject);
3. I bind my RadComboBox to a DataTable, using a BindingSource;
4. I had a binding to the RadComboBox from SelectedValue to a property of myObject;
The problem is that whenever I select an item from de RadComboBox (DropDownList mode), and then I leave the combo changing the focus elsewhere, the combo becomes unselected. I tried the same with the normal ComboBox and it works flawlessly.
Any thoughts on this one? Many thanks in advance!
My code, at Form Load:
I'm having a strange issue in my application. My scenario is as follows:
1. I have a simple form, with a RadComboBox and a TextBox;
2. I have a custom object (say myObject);
3. I bind my RadComboBox to a DataTable, using a BindingSource;
4. I had a binding to the RadComboBox from SelectedValue to a property of myObject;
The problem is that whenever I select an item from de RadComboBox (DropDownList mode), and then I leave the combo changing the focus elsewhere, the combo becomes unselected. I tried the same with the normal ComboBox and it works flawlessly.
Any thoughts on this one? Many thanks in advance!
My code, at Form Load:
cmbTipoCriterioPai.BindingContext = new BindingContext(); |
// Populating the BindingSource |
ServicoTipoCriterio servicoTipoCriterio = new ServicoTipoCriterio(); |
bsPais.DataSource = servicoTipoCriterio.GetDadosPesquisa("0=0"); |
servicoTipoCriterio.Dispose(); |
// DataBinding the RadComboBox |
cmbTipoCriterioPai.DisplayMember = "Designacao"; |
cmbTipoCriterioPai.ValueMember = "ID_TipoCriterio"; |
cmbTipoCriterioPai.DataSource = bsPais; |
// Adding the SelectedValue DataBinding |
cmbTipoCriterioPai.DataBindings.Clear(); |
cmbTipoCriterioPai.DataBindings.Add("SelectedValue", myObject, "ID_TipoCriterioPai"); |