473,592 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FindByText



I have combobox which is filled from database.
Afterwords i will get a criteria for searching a combo by value.
Hao can i make item in combo to be selected when value in combo match
critiria.
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
2 2155
Searching for value:

ComboBox1.Selec tedIndex=ComboB ox1.Items.Index Of(ComboBox1.It ems.FindByValue (
"value_to_searc h_for"))

Searching for text:

ComboBox1.Selec tedIndex=ComboB ox1.Items.Index Of(ComboBox1.It ems.FindByText( "
text_to_search_ for"))

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"acko bogicevic" <ac*******@yaho o.com> wrote in message
news:Ox******** ******@TK2MSFTN GP12.phx.gbl...


I have combobox which is filled from database.
Afterwords i will get a criteria for searching a combo by value.
Hao can i make item in combo to be selected when value in combo match
critiria.
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2


Thanks very much
Alex

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

2
1364
by: Maziar Aflatoun | last post by:
Hi everyone, I am trying to select an item in my DropDownList (Everything on 1 .aspx page) and it gives me the following error message. Has anyone encountered this problem before? or any idea how I can resolve it? (In this case I want to select the Canada from the country list) SqlDataAdapter daCountry = new SqlDataAdapter("SELECT * FROM Country ORDER BY Value", conn); DataSet dsCountry = new DataSet();
0
1446
by: Thomas Scheiderich | last post by:
I have a screen that is trying to search a listbox both by FindByText and FindByValue. The FindByValue is working find, but the FindByText is not finding anything. This is even if I copy the text directly from the source page and paste it into the textbox to make sure I have no typos. Here is the screen: ******************************************************************* <%@Page Explicit="True" Language="VB" Debug="True" %>
0
993
by: Mark | last post by:
I have a dropdownlist that is dynamically populated. I want to make one of the items be selected by default based on PART of the text that is displayed. However, the FindByText method of the dropdownlist is looking for a complete match. Aside from iterating through the entire collection of list items, is there an easier way to find the matching item, and then select it? Thanks in advance. Mark
3
10139
by: AK | last post by:
Hi, I am using FindByText method of dropdownlist to change the selected item in a dropdownlist like this: DropDownList1.Items("mySelectedText").Selected = True It doesn't seem to be doing the trick. I have this piece of code in OnSelectedIndexChanged event of the dropdownlist. Can anyone tell me why it's not setting the selected item?
1
2155
by: JIM.H. | last post by:
Hello, I usee this to find string sD in drop down list and select the value. dllSP.SelectedIndex = dllSP.Items.IndexOf(dllSP.Items.FindByText(sD); Can I get FindByText work with wildcards? So dropdown list has xyzt, and if sD is xyz, I need to select xyzt. Right now it does not select since is expects whole match. How can I do this? Thanks, Jim.
2
3192
by: | last post by:
Hi, is it FindByText case Sensitive? How to set it to case insensitive? Thanks in advance.
4
1869
by: Aneri | last post by:
How to use FindByText property of dropdownlist where text to find is in a textbox? i.e if i write, dropdownlist1.Items.FindByText(" ' "& txt1.Text &" ' ").Selected = True i get error System.NullReferenceException: Object reference not set to an instance of an object
6
7320
by: prpleprncs | last post by:
I have a dropdownlist that is selected on page_load. the values of the dropdown comes from the database using a datasource at design time. the value that needs to be selected comes from the database also. I have tried everything in the world to get the page to load without the System.NullReferenceException: Object reference not set to an instance of an object. I ahve used the trim functions for any possible paddings (there were some). I...
1
1567
by: raam | last post by:
hi I have a list box with some country names from database. when i click search button the "country" list selecteditem should be selected. but it is not. here is my code where iam using a stored procedure which is outputting 3 tables simultaneously. the list box of country is 3rd table that is table if (objDataSet.Tables.Rows.Count > 0) {
0
7935
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8236
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7995
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6642
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3851
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2379
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 we have to send another system
1
1467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1202
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.