[CLOSED] Multicomo fill list and selected items code behind

  1. #1

    [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?

    <%@ 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]
  2. #2
    Hi @jstifel,

    Changing a MultiCombo's Items doesn't affect on a client side representation of that MultiCombo. You can re-render a MultiCombo.

    Protected Sub btn1click(ByVal sender As Object, ByVal args As DirectEventArgs)
        FillBranchMultiCombo(mc1)
        mc1.Render()
    End Sub
         
    Protected Sub btn2click(ByVal sender As Object, ByVal args As DirectEventArgs)
        FillBranchMultiCombo(mc2)
        mc2.Render()
    End Sub

Similar Threads

  1. fill my store from a list of object.
    By DEV_EXT_TN in forum 2.x Help
    Replies: 0
    Last Post: Aug 01, 2012, 11:54 AM
  2. Fill a GridView control from list
    By maruf.zaman in forum 1.x Help
    Replies: 1
    Last Post: Dec 11, 2011, 11:40 AM
  3. [CLOSED] Clear combobox list items in the code behind
    By Marcelo in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 24, 2011, 3:17 PM
  4. Replies: 0
    Last Post: Feb 01, 2010, 12:42 PM
  5. fill gridpanel with a list??
    By carlosmupe in forum 1.x Help
    Replies: 2
    Last Post: Dec 15, 2009, 4:03 PM

Tags for this Thread

Posting Permissions