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

[Solved] Databind Combobox

2 Answers 135 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Meerkat
Top achievements
Rank 1
Meerkat asked on 18 Jul 2008, 09:28 AM
Hello, I am having difficulty using your new ComboBox. I cannot find any documentation and your example project is not much help to me.
I have an address form with

Address
Town
County etc

I would like to use your ComboBox to enable selection of a County.
I have managed to fill the combox with a list of counties (using a web service)

I would like to TwoWay bind the combox to the underlying datacontext so that the actual county is displayed instead of the first in the list. 
Could you please tell me how to do this. The idea of what I am trying to do is very simple but please let me know if I have not explained clearly enough. An example showing how to use your combobox in a real life situation would be absolutely brilliant and I am sure would be useful to many users. Failing that, any help would be greatly appreciated.

Many thanks,

Pete.

2 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 19 Jul 2008, 02:58 PM
Hi Pete,

The attached sample demonstrates how to synchronize two RadComboBox controls and a TextBlock using several bindings and a simple data context object. Important part is the INotifyPropertyChanged implementation in the data context object, which allows the bindings to work properly. If it doesn't help, I will need more information about your scenario and if possible, a very simple user control, demonstrating it. I will try to respond ASAP.

Sincerely yours,
Valeri Hristov (Silverlight Team)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Meerkat
Top achievements
Rank 1
answered on 20 Jul 2008, 08:13 AM

Hello Valeri,
I thank you for your reply but I don't think that is what I am looking for.
Perhaps it is, am I am just being dumb. If this is the case then please accept my apologies for wasting your time.

I think what I am trying to do is an extremely common task that people do every day.

Someone types in their code ( or whatever ) and an address form appears which the user can amend.

Address
Town
County etc.

The details of this address form are obtained via a web service.
getAddress(int code)
The list of counties is also obtained via a web service
getCounties()

The County is your ComboBox filled with the list of counties.
When it first appears, I would like the actual county of the user to be shown ( not necessarily the first county in the list )

I would like to emphasize that the addresses are not all hard coded, but obtained from a database via a webservice.

I would be really happy if you could show me an example of the above scenario because I am struggling, but perhaps that is too difficult.

I appreciate your help very much and and more than willing to send you anything that might help you understand what I am trying to do. The obvious way would be to send you an example project but I do not know how to send you a zip file.

Thanking you in anticipation,

Pete

 

Tags
General Discussions
Asked by
Meerkat
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Meerkat
Top achievements
Rank 1
Share this question
or