473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DropDownList problem

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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.
Nov 16 '05 #1
4 3022
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,

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

"Viktor Popov" <vi****@yahoo.com> wrote in message
news:eV**************@TK2MSFTNGP14.phx.gbl...
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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.

Nov 16 '05 #2
RK
Victor,
If you are referring to the auto-search feature that comes free with .NET
Windows Combobox, I believe there is no such facility with the DropDownList
Web Server Control. But if it is important for your needs, I have seen an
implementation using an additional text box. See
"http://www.dotnet247.com/247reference/a.aspx?u=http://www.aspalliance.com/dotnetsolutions/Article2tmpl.aspx"
HTH,
RK

"Viktor Popov" wrote:
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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.

Nov 16 '05 #3
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" <vi****@yahoo.com> wrote in message
news:eV**************@TK2MSFTNGP14.phx.gbl...
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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.
Nov 16 '05 #4
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" <vi****@yahoo.com> wrote in message
news:Oq**************@TK2MSFTNGP15.phx.gbl...
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" <vi****@yahoo.com> wrote in message
news:eV**************@TK2MSFTNGP14.phx.gbl...
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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 28.9.2004 a.

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brennon Arnold | last post by:
I have a problem that I figured would be relatively common, but have been unable to find any information on it as of yet. I have a page that contains two DropDownList controls, with the second...
12
by: Stanley J Mroczek | last post by:
How do you load a dropdownlist when edit is clicked in a datagrid ? <Columns> <asp:BoundColumn DataField="OptionDescription" ItemStyle-Wrap="True" HeaderText="Option...
2
by: Antonio D'Ottavio | last post by:
Good Morning, In my web page I've a datalist that is sourced by a database, the problem is that I want that one of the column of the datalist contain a dropdownbox that also is sourced by a table...
1
by: Antonio D'Ottavio | last post by:
Good morning, I've a problem with a dropdownlist located inside any row of a datalist, I fill both datalist and dropdownlist at runtime, the problem is with the dropdownlist infact using the event...
10
by: dhnriverside | last post by:
Hi guys Still having a problem with this dropdownlist. Basically, I've got 4. The first 2 work fine, then my code crashes on the 3rd. ddlEndTimeHour.Items.FindByValue(endTime).Selected =...
4
by: Mark Waser | last post by:
I've discovered a very odd bug when attempting to put a dropdown list in a datagrid. In the page PreRender step, the selected index of the datagrid is successfully set during databinding. Yet,...
0
by: Juanjo | last post by:
Hi, Before, I was working with Asp.net 1.0 and datagrid. I posted a question for this issue. The solution of this problem is load the second dropdownlist on the selectedindexchanged event of the...
3
by: Lohboy | last post by:
Using ASP.NET and IE7. (Sorry if I am posting in the wrong forum but my problem seemed to be more related to the JavaScript side than the ASP.NET side.) I have two DropDownList controls the...
1
by: Brett | last post by:
I have a DropDownList in an ASP.NET web form that is populated with items from a lookup table by binding that DropDownList to a SqlDataSource. However, the items in the lookup table can change over...
6
by: shashi shekhar singh | last post by:
Respected Sir, I have to create multiple dynamic dropdownlist boxes and add items dynamically in <asp:table> server control but problem occurs , i.e. except of fist dropdown list no dropdownlist...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.