May 21, 2014, 10:10 PM
[CLOSED] Multicomo fill list and selected items code behind
Dear Sir, I would to be able to fill list and selected items for a multicombo in code behind with no success. Nothing gets displayed.
Please find attached vb code i have written for this purpose. Can you tell me what am I doing wrong?
Please find attached vb code i have written for this purpose. Can you tell me what am I doing wrong?
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<!DOCTYPE html>
<script runat="server">
Private Sub FillBranchMultiCombo(ByVal mc As Ext.Net.MultiCombo)
mc.Items.Clear()
mc.SelectedItems.Clear()
For i As Integer = 1 To 10
mc.Items.Add(New Ext.Net.ListItem With {.Value = i.ToString, .Text = "valor -> " & i.ToString})
If i > 4 And i < 6 Then
mc.SelectedItems.Add(New Ext.Net.ListItem With {.Value = i.ToString, .Text = "valor -> " & i.ToString})
End If
Next
End Sub
Protected Sub btn1click(ByVal sender As Object, ByVal args As DirectEventArgs)
FillBranchMultiCombo(mc1)
End Sub
Protected Sub btn2click(ByVal sender As Object, ByVal args As DirectEventArgs)
FillBranchMultiCombo(mc2)
End Sub
Protected Sub Page_Load(sender As Object, e As EventArgs)
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<extnet:ResourceManager ID="resourceManager" runat="server" />
<extnet:FormPanel runat="server" ID="formpanel1" Layout="FormLayout" Region="Center">
<Items>
<extnet:MultiCombo runat="server" ID="mc1" />
<extnet:MultiCombo runat="server" ID="mc2" />
</Items>
<Buttons>
<extnet:Button runat="server" ID="btn1" Text="mc1">
<DirectEvents>
<Click OnEvent="btn1click" >
</Click>
</DirectEvents>
</extnet:Button>
<extnet:Button runat="server" ID="btn2" Text="mc2">
<DirectEvents>
<Click OnEvent="btn2click" >
</Click>
</DirectEvents>
</extnet:Button>
</Buttons>
</extnet:FormPanel>
</form>
</body>
</html>
Last edited by Daniil; May 28, 2014 at 4:23 AM.
Reason: [CLOSED]