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

ClientDataString

3 Answers 153 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Alex Dybenko
Top achievements
Rank 2
Alex Dybenko asked on 29 Jan 2008, 02:14 PM
Hi,
during migration from old combo I found that:
- here it says that ClientDataString can be used in OnClientItemsRequesting event
http://www.telerik.com/help/radcontrols/prometheus/combo_OnClientItemsRequesting.html
- same time here is says that RadComboBoxItemsRequestedEventArgs.ClientDataString was removed
http://www.telerik.com/help/radcontrols/prometheus/combochanges.html

Looks like the second statement is correct - then can you give an example using ClientDataString or Context ?
And perhaps fix documentation
Thanks
Alex

3 Answers, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 01 Feb 2008, 11:23 AM
Hi Alex Dybenko,

Thank for writing to us!

We know about this inconsistency in the online help and already fixed it. It will be available on the site when we release the official service pack 2 of the Prometheus controls scheduled for the second half of February.

ClientDataString is removed from RadComboBox Prometheus and the context IDictionary object is added.
It allows you to add number of key-value pairs in the OnClientItemsRequesting.

Consider the following javascript function:

function onClientItemsRequestingColor(sender, eventArgs) 
    var comboSkin = $find("<%= comboSkin.ClientID %>"); 
    var context = eventArgs.get_context(); 
    context["SelectedSkin"] = comboSkin.get_selectedItem().get_text(); 
     
    var comboWidth = $find("<%= comboWidth.ClientID %>"); 
    context["SelectedWidth"] = comboWidth.get_selectedItem().get_value();    

In this way we get information from two comboboxes.

Now in the code behind we can do the following:

protected void comboColor_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) 
    string selectedSkin = e.Context["SelectedSkin"].ToString(); 
    string selectedWidth = e.Context["SelectedWidth"].ToString(); 
 
    //custom code here ... 

You can find the full source code in this Code Library:
RadComboBox Prometheus - Context property - demo

More information on how to use the context property in a web service here:
Populate from webservice


Hope this helps.

Sincerely yours,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
TallOne
Top achievements
Rank 2
answered on 26 Jan 2012, 07:36 PM
I wish you guys would update the documentation, here.  I spent a lot of time trying to figure out why ClientDataString did not exist in the class RadComboxItemsRequestedEventArgs only to find out it was migrated to the memeber Context.  :(

Thanks,
TallOne
0
Kalina
Telerik team
answered on 27 Jan 2012, 05:11 AM
Hello,

The article that you mention is related to RadControls for ASP.NET (RadComboBox for ASP.NET).

I suppose that  you use RadComboBox control that is a part of -  RadControls for ASP.NET AJAX. This is a different suite and it has a separate online documentation - please find it here.

Regards,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ComboBox
Asked by
Alex Dybenko
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
TallOne
Top achievements
Rank 2
Kalina
Telerik team
Share this question
or