Sep 20, 2012, 4:29 PM
[CLOSED] linked ComboBox
Hi,
I put in my page two combobox and I want that filter one combobox if I select one item into another combobox, but my code does not work.
I attached an example below
Thank you so much.
I put in my page two combobox and I want that filter one combobox if I select one item into another combobox, but my code does not work.
I attached an example below
<%@ Page Language="C#" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<script runat="server">
protected void ReloadComboBoxAction(object sender, DirectEventArgs e) {
PopulateCombo();
}
protected void PopulateCombo() {
IList list = null;
if (comboBoxWorkCenterAction.SelectedItem == null || comboBoxWorkCenterAction.SelectedItem.Index == 0) {
list = CreateItemsComboBoxOperation();
} else {
list = CreateItemsComboBoxOperation1();
}
for (int i = 0;i < list.Count;i++) {
string operationIth = (string)list[i];
comboBoxOperationAction.Items.Add(new Ext.Net.ListItem(operationIth,i.ToString()));
}
comboBoxOperationAction.DataBind();
}
public IList CreateItemsComboBoxOperation() {
IList listaOperation = new ArrayList();
string element1 = "operation 01";
string element2 = "operation 02";
string element3 = "operation 03";
listaOperation.Add(element1);
listaOperation.Add(element2);
listaOperation.Add(element3);
return listaOperation;
}
public IList CreateItemsComboBoxOperation1() {
IList listaOperation = new ArrayList();
string element1 = "operation 01";
string element3 = "operation 03";
listaOperation.Add(element1);
listaOperation.Add(element3);
return listaOperation;
}
public void Page_Load() {
PopulateCombo();
}
</script>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<h1>Example</h1>
<ext:Panel runat="server" Layout="HBoxLayout" Border="false" AutoHeight="true" Header="false">
<Defaults>
<ext:Parameter Name="margins" Value="5 5 0 5" Mode="Value" />
</Defaults>
<LayoutConfig>
<ext:HBoxLayoutConfig />
</LayoutConfig>
<Items>
<ext:ComboBox ID="comboBoxWorkCenterAction" runat="server" EmptyText="-- All --">
<Items>
<ext:ListItem Text="WorkCenter1" />
<ext:ListItem Text="WorkCenter2" />
<ext:ListItem Text="WorkCenter3" />
</Items>
<DirectEvents>
<Select OnEvent="ReloadComboBoxAction">
<EventMask ShowMask="true" MinDelay="200" />
</Select>
</DirectEvents>
</ext:ComboBox>
<ext:ComboBox ID="comboBoxOperationAction" runat="server" EmptyText="-- All --">
</ext:ComboBox>
</Items>
</ext:Panel>
</form>
</body>
</html>
Can you help me for this issue?Thank you so much.
Last edited by Daniil; Sep 21, 2012 at 12:23 PM.
Reason: [CLOSED]