Feb 09, 2011, 5:46 AM
[CLOSED] Combo value problem
Hi..
i have kept 1 combo box,empty text field,button and another text field to display the combo value..
im displaying the value of commodity names in commodity value text field...
if user selcet commodity name from combo and clicks on button it will display the commodity value in commodity value text field...
it is workig fine if user selects commodity name and clicks on button..see picture(WithoutEdit.jpg )
if user try to edit combo box(EditAndPressTab.jpg) and press tab it will display previously selected combo item in combo box and then clicks on button it will not display value in commodity value text field..instead of value it is displaying text..(afterEdit.jpg)
how to solve this problem?
i have kept 1 combo box,empty text field,button and another text field to display the combo value..
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="grid.WebForm1" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager runat="server">
</ext:ScriptManager>
<ext:ComboBox ID="cmbCommodityName" runat="server" Width="165" FieldLabel="Commodity Name">
<Items>
<ext:ListItem Text="AAA" Value="0" />
<ext:ListItem Text="BBB" Value="1" />
<ext:ListItem Text="CCC" Value="2" />
<ext:ListItem Text="DDD" Value="3" />
<ext:ListItem Text="EEE" Value="4" />
<ext:ListItem Text="FFF" Value="5" />
<ext:ListItem Text="GGG" Value="6" />
<ext:ListItem Text="HHH" Value="7" />
</Items>
<SelectedItem Text="AAA" Value="0" />
</ext:ComboBox>
<ext:TextField runat="server" />
<ext:Button ID="btnSave" Text="Save" runat="server" >
<AjaxEvents>
<Click OnEvent="btnSave_Click" />
</AjaxEvents>
</ext:Button>
<ext:TextField ID="txtCommodity" runat="server" FieldLabel="Commodity Value" />
</form>
</body>
</html>
protected void btnSave_Click(object sender, AjaxEventArgs e)
{
txtCommodity.Text = cmbCommodityName.SelectedItem.Value;
}
im displaying the value of commodity names in commodity value text field...
if user selcet commodity name from combo and clicks on button it will display the commodity value in commodity value text field...
it is workig fine if user selects commodity name and clicks on button..see picture(WithoutEdit.jpg )
if user try to edit combo box(EditAndPressTab.jpg) and press tab it will display previously selected combo item in combo box and then clicks on button it will not display value in commodity value text field..instead of value it is displaying text..(afterEdit.jpg)
how to solve this problem?
Last edited by geoffrey.mcgill; Feb 09, 2011 at 5:19 PM.
Reason: [CLOSED]