DropDownList problem

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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,
 
V

Viktor Popov

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
 
I

Ignacio Machin \( .NET/ C# MVP \)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Populate DropDownList 9
dropdownlist 1
very strange problem 5
tables search 2
ASP.NET/C# Help 1
Navigate Datagrid 4
dropdownlist 4
How can I do this 2

Top