Feb 05, 2011, 12:05 PM
[CLOSED] Combobox Data Binding Problem
Hi all,
I have Faced a Problem with Combobox Databinding means if we r Having 4 combobox items as A,B,C,D and for this Items Value wil be 1,2,3,4 ..here Combobox Id is cmb1.
then if we set cmb1.selectedItem.Value and if we select A then the value will be 1.. here i set the Combo property as ForceSelection="True" ..
then i select A and i enter some thing in combo like asasa then suddnly i click on submit button with out using cursor then cmb1.selectedItem.Value will be A. not 1.
so how to rectify this Problem plz solve this..
See this Example
But the Problem is when we Select A and Type as AXYZ and Click on Button then
Thanks in Advance..
I have Faced a Problem with Combobox Databinding means if we r Having 4 combobox items as A,B,C,D and for this Items Value wil be 1,2,3,4 ..here Combobox Id is cmb1.
then if we set cmb1.selectedItem.Value and if we select A then the value will be 1.. here i set the Combo property as ForceSelection="True" ..
then i select A and i enter some thing in combo like asasa then suddnly i click on submit button with out using cursor then cmb1.selectedItem.Value will be A. not 1.
so how to rectify this Problem plz solve this..
See this Example
<ext:ComboBox ID="cmb1" runat="server" ForceSelection="true" >
<Items>
<ext:ListItem Text="A" Value="1" />
<ext:ListItem Text="B" Value="2" />
<ext:ListItem Text="C" Value="3" />
<ext:ListItem Text="D" Value="4" />
</Items>
</ext:ComboBox>
In code behind:int No=0;
No=cmb1.SelectedItem.value;
Here the No value we will get as 1.this will be correct.But the Problem is when we Select A and Type as AXYZ and Click on Button then
No=cmb1.SelectedItem.value; // here the No is getting like AXYZ ..
so how to Rectify this Problem...plz Help..Thanks in Advance..
Last edited by Daniil; Feb 09, 2011 at 1:55 PM.
Reason: Please use [CODE] tags for code only, [CLOSED]