DropDownList problem

  • Thread starter Thread starter Viktor Popov
  • Start date Start date
V

Viktor Popov

Hi,

I use a DropDownList for presenting information from DataBase. Here it is
the code:

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
SqlConnection conn = new SqlConnection("Data Source=BLEK;Initial
Catalog=Estate; User ID=@@@; Password=@@@@@");
SqlDataAdapter dad1 = new SqlDataAdapter ("SELECT o.OfferID,o.TypeOffer FROM
blek.TypeOffer o ORDER BY o.TypeOffer", conn);
DataSet ds =new DataSet();
conn.Open();
dad1.SelectCommand.ExecuteNonQuery();
dad1.Fill(ds,"Offers");
DDL1.DataSource=ds.Tables[0];
DDL1.DataValueField = "OfferID";
DDL1.DataTextField = "TypeOffer";
DDL1.DataBind();
conn.Close();
}
}

The problem is that when I like to Search by letter in the DropDownList
DDL1 it doesn't work. How could be enabled this feature?
Thank you!

Viktor
 
Hi Viktor,

I think that you asked this before, and I asked back to what do you
understand by "search by letter" ?
You never answered that.

Cheers,
 
Thank you for the replies.
Search by letter for me means when in the DropDown list is information like
this:
Alabama
Argentina
Atlanta
and the user types "A" the selection goes to Alabama.Than when he/she types
"R" the selection goes to Argentina.
Thank you !

Viktor


Viktor Popov said:
Hi,

I use a DropDownList for presenting information from DataBase. Here it is
the code:

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
SqlConnection conn = new SqlConnection("Data Source=BLEK;Initial
Catalog=Estate; User ID=@@@; Password=@@@@@");
SqlDataAdapter dad1 = new SqlDataAdapter ("SELECT o.OfferID,o.TypeOffer FROM
blek.TypeOffer o ORDER BY o.TypeOffer", conn);
DataSet ds =new DataSet();
conn.Open();
dad1.SelectCommand.ExecuteNonQuery();
dad1.Fill(ds,"Offers");
DDL1.DataSource=ds.Tables[0];
DDL1.DataValueField = "OfferID";
DDL1.DataTextField = "TypeOffer";
DDL1.DataBind();
conn.Close();
}
}

The problem is that when I like to Search by letter in the DropDownList
DDL1 it doesn't work. How could be enabled this feature?
Thank you!

Viktor
 
Hi,

There is no control that does that, you have to implement it in javascript,
I did it a LONG time ago but I have no idea where to find it now.
if you search in a javascript NG I'm sure you will find some examples.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



Viktor Popov said:
Thank you for the replies.
Search by letter for me means when in the DropDown list is information like
this:
Alabama
Argentina
Atlanta
and the user types "A" the selection goes to Alabama.Than when he/she types
"R" the selection goes to Argentina.
Thank you !

Viktor


Viktor Popov said:
Hi,

I use a DropDownList for presenting information from DataBase. Here it is
the code:

private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
SqlConnection conn = new SqlConnection("Data Source=BLEK;Initial
Catalog=Estate; User ID=@@@; Password=@@@@@");
SqlDataAdapter dad1 = new SqlDataAdapter ("SELECT o.OfferID,o.TypeOffer FROM
blek.TypeOffer o ORDER BY o.TypeOffer", conn);
DataSet ds =new DataSet();
conn.Open();
dad1.SelectCommand.ExecuteNonQuery();
dad1.Fill(ds,"Offers");
DDL1.DataSource=ds.Tables[0];
DDL1.DataValueField = "OfferID";
DDL1.DataTextField = "TypeOffer";
DDL1.DataBind();
conn.Close();
}
}

The problem is that when I like to Search by letter in the DropDownList
DDL1 it doesn't work. How could be enabled this feature?
Thank you!

Viktor
 
Back
Top