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

Data Bindings Not Displaying For DropDownList

2 Answers 270 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 20 Jun 2019, 11:56 PM

I have a dropdownList that has the following:

DataSource: binds to a table with 2 columns (ID, Style)

DisplayMember: Is Set to "Style"

ValueMember: Is Set to "Style"

 

I have a binding source which binds to an model. One of its properties, "PartitionStyle" is a string value.

I set the dropdownList DataBinding.Text: BindingSource.PartitionStyle (Note, I did also try DataBinding.SelectedValue as well)

Now when I choose a value from the drop down list, the "PartitionStyle" property updates to that value which is great. So I save that model and close the form down. Now when I relaunch the form passing in that model to the bindingsource, the display or text of that dropdownlist does not have the correct value(has the index 0 value selected).

I've tried setting BindingSource.DataSource to that model, then BindingSource.ResetBindings, it doesn't work. All the rest of the controls that are NOT dropdownList are displaying correctly(textboxes have the correct values from the properties they are binded to, checkboxes as well).

Any help?

2 Answers, 1 is accepted

Sort by
0
Derek
Top achievements
Rank 1
answered on 21 Jun 2019, 05:44 PM
Nevermind, I was able to fix it. I was calling the BindingSource.ResetBindings a little earlier than when the event went off when loading the form.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Jun 2019, 08:26 AM
Hello, Derek,  

I am glad that you have found a suitable solution for your scenario.

Note that if you are experiencing any further difficulties, it would be greatly appreciated if you can submit a support ticket from your account and provide a sample project demonstrating the undesired behavior. Thus, our support engineers will gladly assist you.

I would recommend you to have a look at the following tutorial demonstrating how the simple data binding works: https://www.codeproject.com/Articles/11530/Understanding-Simple-Data-Binding

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DropDownList
Asked by
Derek
Top achievements
Rank 1
Answers by
Derek
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or