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

Problem in displaying EmtyText while clicking the comboboxitem when it is dynamically created

1 Answer 56 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
jeevitha
Top achievements
Rank 1
jeevitha asked on 26 Apr 2010, 10:58 AM
Hi,

I am creating a combobox in codebehind dynamically with checkbox template. I am inserting "Select" as a selected item. When i am clicking the CheckBox of the item I called the CheckboxOnclick event. But When i am clicking the Item text the "Select" text which i had as selected item changes to the item text which i clicked. Actually that should not happen. The select text should be the same. How to over come this problem and is there any way  to prevent ItemClick event dynamically. I have given EmptyText also dynamically which is not worked. Pls help me out to sort this problem. I tried OnItemRequested it is also not working.

Thanks,
Jeevitha

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 26 Apr 2010, 05:04 PM
Hello jeevitha,

Try using these two steps to set an EmptyMessage to your RadComboBox:

1. Set AllowCustomText="true" and some text to the EmptyMessage property. For example EmptyMessage="Select ..."
2. use this Javascript function:

function onLoad(sender) {
                sender.get_inputDomElement().readOnly = "readonly";
            }

You may find the full code in the attached .zip file.

Hope this helps.

Regards,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
jeevitha
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or