[CLOSED] GridPanel - ComponentColumn - ComboBox: How to bind data??

  1. #1

    [CLOSED] GridPanel - ComponentColumn - ComboBox: How to bind data??

    Hi and thank you in advance for your responses.

    I'm trying to show a combobox in a gridpanel using ComponentColumn. The thing is that I'm not able to bind data. Data are not shown or the gridpanel is not shown.

    I'm trying it in 2 ways:

    1.
    <ext:ComponentColumn ID="ComponentColumn1" 
                                            runat="server" 
                                            DataIndex="ESTADO"
                                            Flex="1"
                                            Text="Estado"
                                            Editor="true">
                                            <Component>
                                                <ext:ComboBox ID="comboEstadoAsignacionIndividual" runat="server"  DisplayField="Descripcion" ValueField="Valor"
                                                    QueryMode="Local" TypeAhead="true">
                                                    <Store>
                                                        <ext:Store ID="storeEstadoAsignacionIndividual" runat="server" Data="<%# Estados %>" AutoDataBind="true">
                                                            <Model>
                                                                <ext:Model ID="Model4" runat="server" IDProperty="Valor">
                                                                    <Fields>
                                                                        <ext:ModelField Name="Descripcion" Type="String" ServerMapping="Descripcion" />
                                                                        <ext:ModelField Name="Valor" Type="Int" ServerMapping="Valor" />
                                                                    </Fields>
                                                                </ext:Model>
                                                            </Model>
                                                            <Reader>
                                                                <ext:ArrayReader />
                                                            </Reader>
                                                        </ext:Store>
                                                    </Store>
                                                </ext:ComboBox>
                                            </Component>
                                        </ext:ComponentColumn>
    Where "Estados" return correctly a list (it is used correctly by another combobox outside the gridpanel):

    Protected ReadOnly Property Estados() As List(Of ElementosEnumerados)
            Get
                Dim lista As List(Of ElementosEnumerados) = Enumerados.RecuperarEstadosAbonos()
                Return lista
            End Get
        End Property
    2.
    <ext:ComboBox ID="comboEstadoAsignacionIndividual" runat="server" AllowBlank="false" Editable="false">
                                                </ext:ComboBox>
    and

    Dim lista As List(Of ElementosEnumerados) = Enumerados.RecuperarEstadosAbonos()
    
                For Each estado In lista
                    comboEstadoAsignacionIndividual.Items.Add(New Ext.Net.ListItem(estado.Descripcion, estado.Valor))
                Next

    Any help??

    Thanks again.
    Last edited by Daniil; Aug 20, 2013 at 5:27 PM. Reason: [CLOSED]
  2. #2
    Hi @jamesand,

    Please clarify do you need to bind to a ComboBox different data for different rows or the same data for all the rows?
  3. #3
    The same data to all the rows
  4. #4
    1. Store's Data. What kind of data you are binding? What is the ElementosEnumerados? Are you able to provide us with a runnable test case? Please try to remove ArrayReader.

    2. ComboBox's Items. Where do you execute this code?
    comboEstadoAsignacionIndividual.Items.Add(New Ext.Net.ListItem(estado.Descripcion, estado.Valor))
    Page_Load or DirectEvent?
  5. #5
    Daniil I don't know how but I fixed it... I just changed the way another combobox got the data and then it worked.... Really weird.

    Thank you anyway.

Similar Threads

  1. Replies: 0
    Last Post: Feb 22, 2013, 2:24 PM
  2. [CLOSED] Combobox with AjaxProxy - bind data at initial load
    By mj.daly in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Feb 06, 2013, 8:49 AM
  3. Bind Data to GridPanel
    By huangzhs in forum 1.x Help
    Replies: 7
    Last Post: Nov 17, 2009, 4:04 AM
  4. Replies: 0
    Last Post: Jun 19, 2009, 4:18 AM
  5. how to bind data for gridpanel in codebehind?
    By tangcan2003 in forum 1.x Help
    Replies: 2
    Last Post: Mar 12, 2009, 6:11 AM

Tags for this Thread

Posting Permissions