Feb 07, 2018, 1:17 PM
[CLOSED] Not able to get selected item value of Empty Liste Item of Combobox on Code Behind (server side)
Hi, We are using Ext.Net 2.5 version, facing an issue with Combobox selected item is not getting on server side of Empty Text item.
- I add items to my combobox dynamically using store databinding but I obtain an empty string from the SelectedItem.Value when the item doesn't have any text.
- whereas I am able get the value from Javascript.
- I am unable to get value of the selecteditem if I select empty item.
//Designer
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
this.Store1.DataSource = new object[]
{
new object[] { "11", "Group1", },
new object[] { "12", "", },
new object[] { "13", "Group3", },
new object[] { "14", "Group4", }
};
}
</script>
<ext:Store ID="store1" runat="server" AutoLoad="true">
<Model>
<ext:Model ID="Model11" runat="server">
<Fields>
<ext:ModelField Name="GroupID" />
<ext:ModelField Name="GroupName" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
<ext:ComboBox ID="cbo1" runat="server" StoreID="store1"
DisplayField="GroupName" ValueField="GroupID"
EmptyText="Select" Width="200" Editable="true"
TypeAhead="true" ForceSelection="true" TriggerAction="All"
SelectOnFocus="true">
</ext:ComboBox>
//Code Behind
Dim GroupID As Integer = -1
If Not cbo1.SelectedItem.Value = Nothing And cbo1.SelectedItem.Index <> -1 Then
GroupID = cboContactGroup.SelectedItem.Value
End If
Last edited by fabricio.murta; Apr 13, 2018 at 6:40 PM.
Reason: no feedback from the user in 7+ days