how to Add ComboBox in GridPanel

  1. #1

    how to Add ComboBox in GridPanel

    hello guys
    How to Add ComboBox in GridPanel?
    I Try it more and more ,using selectionModel?
    How to use it?
  2. #2

    RE: how to Add ComboBox in GridPanel

    Hi supermanok,

    Does the following help solve the problem? see*http://forums.ext.net/showthread.php?postid=5287.aspx




    Geoffrey McGill
    Founder
  3. #3

    RE: how to Add ComboBox in GridPanel

    see my upload IMG
    why the first item is "nbsp;"
    and when i selected,that row will display my data ID,
    ex:two items 1:id 2:name
    when i selected,that row display Id,not name.
    does not display i selected
    aspx code:
                                                <ext:Column Header="station Name">
                                                    <Editor>
                                                        <ext:ComboBox ID="cmbStation" runat="server" ReadOnly="true" >
                                                        </ext:ComboBox>
                                                    </Editor>
                                                </ext:Column>
    background code:
       public void BindCombo()
        {
            DataTable dt = DB.Select().From<TStationcharacter>().ExecuteDataSet().Tables[0];
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    cmbStation.Items.Add(new Coolite.Ext.Web.ListItem(dt.Rows[i]["C_TYPENAME"].ToString(), dt.Rows[i]["C_ID"].ToString()));
                }
            }
        }
  4. #4

    RE: how to Add ComboBox in GridPanel

    Hi,

    It is difficult to say what wrong without full example.
    The single wrong thing I saw in your existing code that your column have no DataIndex


  5. #5

    RE: how to Add ComboBox in GridPanel

    thank you ,i added now ,but the problem still yet
  6. #6

    RE: how to Add ComboBox in GridPanel

    Hi,

    in this example you can see how to use ComboBox in Grid
    https://examples1.ext.net/#/GridPane...SqlDataSource/

  7. #7

    RE: how to Add ComboBox in GridPanel



    thank you everybody.
    i try any method,but the combobox can not display Text,it's display value field yet
    i used store ,DataTable,DatatSet to bind.fuction is ok,display is wrong.
            //DataTable dt = DB.Select().From<TStationcharacter>().ExecuteDataSet().Tables[0];
    
    
            //if (dt.Rows.Count > 0)
            //{
            //    for (int i = 0; i < dt.Rows.Count; i++)
            //    {
            //        cmbName.Items.Add(new Coolite.Ext.Web.ListItem(dt.Rows[i]["C_TYPENAME"].ToString(), dt.Rows[i]["C_ID"].ToString()));
            //        cmbName.SetValueAndFireSelect(dt.Rows[i]["C_TYPENAME"].ToString());
            //    }
            //}
            //DataTable dt2 = DB.Select().From<TLines>().ExecuteDataSet().Tables[0];
            //if (dt2.Rows.Count > 0)
            //{
            //    for (int i = 0; i < dt2.Rows.Count; i++)
            //    {
            //        cmbLineCode.Items.Add(new Coolite.Ext.Web.ListItem(dt2.Rows[i]["L_NAME"].ToString(), dt2.Rows[i]["L_ID"].ToString()));
            //    }
            //}
    
    
            storeStation.DataSource = DB.Select().From<TStationcharacter>().ExecuteDataSet();
    
    
            storeStation.DataBind();

    aspx:
     <ext:Column Header="Station" DataIndex="S_NAME">
                                                    <Editor>
                                                        <ext:ComboBox ID="cmbName" runat="server" StoreID="storeStation" DisplayField="C_TYPENAME" ValueField="C_ID">
                                                        </ext:ComboBox>
                                                    </Editor>
                                                </ext:Column>
  8. #8

    RE: how to Add ComboBox in GridPanel

    Hi

    When i Using This Code For creating A template in comboBox

    <ext:ComboBox ID="ComboBox1" runat="server" StoreID="Store2"
    ValueField="BookID"
    DisplayField="Title"
    TypeAhead="true" Mode="Local"
    AutoPostBack="true" ForceSelection="true"
    TriggerAction="All" EmptyText="Select One" ItemSelector="div.list-item">
    <Template ID="Template1" runat="server" >
    <tpl for=".">
    <div class="list-item">
    <h3>{Title}</h3>
    {Title}


    </tpl>

    </Template>
    <Template ID="Template2" runat="server">

    </Template>
    </ext:ComboBox>




    It Showing this Error


    #### 1 Validation (XHTML 1.0 Transitional): Element 'tpl' is not supported......

    But The combo Is working. What can do to solve this problem.

    Sreejith.


  9. #9

    RE: how to Add ComboBox in GridPanel

    Hi,

    Is it a problem for you? Just this non-standard tags using by combo for building template. Just ignore this validation message.


Similar Threads

  1. Replies: 4
    Last Post: Nov 30, 2011, 5:25 AM
  2. Replies: 2
    Last Post: May 05, 2011, 10:16 AM
  3. Two ComboBox in GridPanel
    By SETConsulting in forum 1.x Help
    Replies: 0
    Last Post: Feb 10, 2011, 2:28 PM
  4. Replies: 6
    Last Post: Mar 20, 2009, 5:39 PM
  5. GridPanel ComboBox Bug
    By Timothy in forum Bugs
    Replies: 5
    Last Post: Dec 08, 2008, 11:22 AM

Posting Permissions