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

How To Disallow user Key In text in a Combobox which contains checkbox

2 Answers 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
johnson lim
Top achievements
Rank 1
johnson lim asked on 12 Jan 2012, 04:27 AM
Hi,
I want to disallow user from keying text in the combo box which contains checkbox. Because this will cause error to happen.
The error message is as below:



I have try to set AllowCustomText="false" but it seems that it do not take action when there is checkbox inside the combobox.
Below is is my sample code

<ajax:RadComboBox ID="DdlProject" runat="server" Width="240px" EnableLoadOnDemand="True" Text=" " AllowCustomText="false"
                           EnableVirtualScrolling="true" EnableAutomaticLoadOnDemand="true">
                           <ItemTemplate>
                               <asp:CheckBox runat="server" ID="chkProject" oncheckedchanged="chk_CheckedChangedProject" AutoPostBack="true"  Text='<%#Eval("ProjectName")%>' />
                           </ItemTemplate>
                       </ajax:RadComboBox>
 
 
dsProject = getGetProject(mstrCompNo)
 
           DdlProject.DataSource = dsProject
           DdlProject.DataTextField = "ProjectId"
           DdlProject.DataValueField = "ProjectName"
           DdlProject.DataBind()

Does anyone has any idea? Help Please!!

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Jan 2012, 05:06 AM
Hello,

I have tried to reproduce the same but no avail. Try setting AllowCustomText and MarkFirstMatch properties as false.
Also take a look into the following demo.
ComboBox / CheckBoxes
Hope it helps.

Thanks,
Princy.
0
johnson lim
Top achievements
Rank 1
answered on 12 Jan 2012, 06:42 AM
Thanks Princy for your prompt help !! ^^
Tags
ComboBox
Asked by
johnson lim
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
johnson lim
Top achievements
Rank 1
Share this question
or