Data not binding into ComboBox

  1. #1

    Data not binding into ComboBox

    Hai Everybody
    Data is not binding into Combobox through DirectEvent, but when we are write code in pageload its working fine
    Anybody tell me the reason,and i have used the sourcecode of ext.net2.0Rc1.
    here is the code
    <%@ Page Language="C#" AutoEventWireup="true"  Inherits="FieldContainerForm" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
       <script type="text/javascript" runat="server">
     protected void get(object sender, DirectEventArgs e)
        {
            cn.Open();
            SqlCommand cmd = new SqlCommand("select phone from empdetails", cn);
            SqlDataReader dr = cmd.ExecuteReader();
            while (dr.Read())
            {
                cb1.Items.Add(new Ext.Net.ListItem(dr["phone"].ToString()));
            }
           
            dr.Close();
            cn.Close();
        }
    </script>
    </head>
    <body>
     <form id="form1" runat="server">
        <div>
           <ext:Button ID="b1" runat="server" Text="Get" OnDirectClick="get"></ext:Button>
             <ext:ComboBox ID="cb1" runat="server" Width="100" Text="Split Data"></ext:ComboBox>
         </div>
      </form>
    </body>
    </html>
  2. #2
    Hi,

    Please call:
    cb1.GetStore().DataBind();
    when you populate the ComboBox Items during DirectEvent or DirectMethod.
  3. #3

    Hai Daniil

    Hai Daniil Thankq for Reply, its working fine...
  4. #4

    Hai Daniil

    Hai Daniil its working fine well in outside window,
    but directmethod is not firing at first click of button in window, after selection of few other windows, then direct method is firing...
    i have posted about these issues many times, those links you find here.
    http://forums.ext.net/showthread.php...5590#post85590
    http://forums.ext.net/showthread.php...in-ext-net-2-0

    Thanq
  5. #5
    I have followed the links. The issues appear to be resolved. Could you confirm?
  6. #6

    Hai Daniil

    Hai Daniil Thanks for Following My links, those issues are solved using the Ext.Net2.0.0Rc2.
    but one link is there today i have posted plz check this...
    http://forums.ext.net/showthread.php...t-Net2-0-0Rc2)

    Thankq once again...

Similar Threads

  1. ComboBox data binding
    By AlexMaslakov in forum 1.x Help
    Replies: 3
    Last Post: Jun 13, 2013, 9:04 AM
  2. [CLOSED] ComboBox in user control binding but not showing data
    By Digital.Dynamics in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: May 08, 2012, 12:09 PM
  3. [CLOSED] Data binding to NetTiers data entity objects
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Apr 09, 2012, 3:35 PM
  4. [CLOSED] Combobox Data Binding Problem
    By Vasudhaika in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 09, 2011, 1:55 PM
  5. Combobox not binding data
    By Satyanarayana murthy in forum Open Discussions
    Replies: 0
    Last Post: Jun 27, 2009, 12:22 PM

Posting Permissions