Using VS.NET 2002\Web Form\VB
I have a dropdown list that will contain letters of the alphabet. At
startup, it has only the letter A in the list. I add letters to the items
list, as needed. However, before I add a new letter, I need to see if the
letter is already in the list. After determing the letter that I will be
looking for:
Dim newLtr as string = "B"
I have tried to use the following in my code behind to see if that letter is
in the item list:
DrpDwnLst1.Items.FindByText(newLtr)
DrpDwnLst1.Items.Contains(newLtr)
Either of those two ways gives me that squiggle line underneath that
indicates it can't digest what I am trying to do.
I have no problems adding items, just can't seem to find a way to search the
list. Can someone tell me what I'm doing wrong?
Thanks,
George 2 5344
DrpDwnLst1.Items.Contains takes a "ListItem" as a argument and not a string.
So do something like this:
DrpDwnLst1.Items.Contains(new ListItem(newLtr))
Hope this helps,
Martha
"George" <------@----.---> wrote in message
news:9i*********************@bgtnsc04-news.ops.worldnet.att.net... Using VS.NET 2002\Web Form\VB
I have a dropdown list that will contain letters of the alphabet. At startup, it has only the letter A in the list. I add letters to the items list, as needed. However, before I add a new letter, I need to see if the letter is already in the list. After determing the letter that I will be looking for:
Dim newLtr as string = "B"
I have tried to use the following in my code behind to see if that letter
is in the item list:
DrpDwnLst1.Items.FindByText(newLtr) DrpDwnLst1.Items.Contains(newLtr)
Either of those two ways gives me that squiggle line underneath that indicates it can't digest what I am trying to do.
I have no problems adding items, just can't seem to find a way to search
the list. Can someone tell me what I'm doing wrong?
Thanks, George
Martha,
That did the trick! Thanks very much. I appreciate your time. ;-)
George
"Martha[MSFT]" <ma******@online.microsoft.com> wrote in message
news:On**************@TK2MSFTNGP09.phx.gbl... DrpDwnLst1.Items.Contains takes a "ListItem" as a argument and not a
string. So do something like this:
DrpDwnLst1.Items.Contains(new ListItem(newLtr))
Hope this helps, Martha "George" <------@----.---> wrote in message news:9i*********************@bgtnsc04-news.ops.worldnet.att.net... Using VS.NET 2002\Web Form\VB
I have a dropdown list that will contain letters of the alphabet. At startup, it has only the letter A in the list. I add letters to the
items list, as needed. However, before I add a new letter, I need to see if
the letter is already in the list. After determing the letter that I will be looking for:
Dim newLtr as string = "B"
I have tried to use the following in my code behind to see if that
letter is in the item list:
DrpDwnLst1.Items.FindByText(newLtr) DrpDwnLst1.Items.Contains(newLtr)
Either of those two ways gives me that squiggle line underneath that indicates it can't digest what I am trying to do.
I have no problems adding items, just can't seem to find a way to search the list. Can someone tell me what I'm doing wrong?
Thanks, George
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nathan |
last post by:
Hello all,
Thanks for all your help in the past.
To start off, I'm much more familiar with the web aspect of this stuff. So a
DropDownList in the middle of a DataSet or Repeater is no big...
|
by: Frawls |
last post by:
Hi,
This is concerned with System.Web.UI.WebControls.DropDownList
I am having problems creating a method which will remove list items
from a preloaded dropdownlist. This dropdown is loaded...
|
by: Big Dave |
last post by:
I know it's been asked a million times before, but I still can't seem to
find an answer that works.
I've got a dropdown list in the footer template of a datagrid. The
dropdown list databinds,...
|
by: JIM.H. |
last post by:
Hello,
I have a dropdown list, updated through a dataset. After bind, I use this to
add extra item to my dropdown list. myDropDownList.Items.Add(“Item1”), I can
remove that by using...
|
by: Oleg |
last post by:
Hi,
I'm having a problem with page caching and therefore reusing dropdown box
contents.
Scenerio:
user1 has security to see list of three items(.aspx populates it with three
items only) in...
| |
by: Alex |
last post by:
Hi Everyone --
I have two tables, one has a list of Items and one a list of Bidders.
I'm creating a Form to allow the user to select the Bidder Name from a
dropdown list. I want the Bidder Name...
|
by: =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?= |
last post by:
Hello.
I am reading a value from a table and trying to determine if that value
exists in a list of values associated with a dropdownlist. If so, I select
the value, otherwise, I don't. I haven't...
|
by: phpmel |
last post by:
hi guys,
I am using Visual Studio 2005. I have a dropdown list that has an associated SQLdatasource. I also have a textbox below the dropdown list that allows you to add items to the table that...
|
by: Cralis |
last post by:
Hi guys,
Someone once said, 'You can do that with reflection'. I can't recall
what it was I was trying to do at the time, but then he said, 'Any
developer knows what reflection is...'. I kept...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |