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

SlectedIndexChanged not firing

2 Answers 80 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 28 May 2008, 08:39 PM
Hello,

Using a code similar to the TreeView in RadComboBox, setting the combo to AutopostBack, I am unable to Ajaxify the RadComboBox...because the RadComboBox wait a click in the browser window after selecting a treeview node before starting the postback.

I would appreciate a workaround for this, thanks for help.

CS

2 Answers, 1 is accepted

Sort by
0
CSurieux
Top achievements
Rank 2
answered on 28 May 2008, 09:12 PM
Hello,

I tried this
function nodeClicking(sender, args)
        {
            var comboBox = $find('RadComboBox1');
            var node = args.get_node()
            var items=comboBox.get_items();
            var itm=items.getItem(0);
            comboBox.trackChanges();
            var comboItem = new Telerik.Web.UI.RadComboBoxItem();
            comboItem.set_text(node.get_text());
            comboItem.set_value(node.get_value());
            items.insert(0,comboItem);
            comboBox.commitChanges();
            comboBox.hideDropDown();
            comboItem.select();
            }
I get a postback but an exception
[NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.]
   Telerik.Web.UI.ControlItem.LoadFromDictionary(IDictionary`2 dictionary) +165
   Telerik.Web.UI.ClientStateLogPlayer.Insert(ClientStateLogEntry entry, ControlItemCollection items, Int32 index) +168
   Telerik.Web.UI.ClientStateLogPlayer.Play(ClientStateLogEntry entry) +222
   Telerik.Web.UI.ClientStateLogPlayer.Play(IEnumerable`1 clientStateLogEntry) +94
   Telerik.Web.UI.RadComboBox.LoadClientState(RadComboBoxClientState clientState) +102
   Telerik.Web.UI.RadComboBox.LoadPostData(String postDataKey, NameValueCollection postCollection) +282
   Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +36
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +661
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194



Shouldn't it work ?

CS
0
Veselin Vasilev
Telerik team
answered on 30 May 2008, 12:47 PM
Hello Christian Surieux,

Please make sure that the tree nodes have Text and Value properties set. I've managed to reproduce the problem when the clicked node did not have a Value set (since you are using comboItem.set_value(node.get_value());)

I hope this helps.


All the best,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
CSurieux
Top achievements
Rank 2
Answers by
CSurieux
Top achievements
Rank 2
Veselin Vasilev
Telerik team
Share this question
or