'FindStringExact' is not a member of 'System.Web.UI.WebControls.ListBox'.

R

Richard

Dim index As Integer = lbSysteem.FindStringExact(strSysteem)

basicly i want to return the value but as the examples show on the MSDN
library, nothings wrong with the code?
if FindStringExact isnt a member of Listbox then from what is it?

thx in advance,

Richard
 
G

Gary Chang

Hi Richard

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.


Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
R

Richard

I found a way around it, by just looping throu the listbox control althrou
the FindStringExact would make it much easier and less code, my problem is
solved. It is only used in the "System.Windows.Forms" which isnt in my .NET
Framework or I ever heared of it. I am just going to find some more info
about it so I wont have the problem again in the future.

Thx for your help anyway.

Richard
 
J

John Saunders

Richard said:
Dim index As Integer = lbSysteem.FindStringExact(strSysteem)

basicly i want to return the value but as the examples show on the MSDN
library, nothings wrong with the code?
if FindStringExact isnt a member of Listbox then from what is it?

FindStringExact is a member of System.Windows.Forms.ListBox, not of
System.Web.UI.WebControls.ListBox.
 
S

Steven Cheng[MSFT]

Hi Richard,

In addition to loop through the DropDownList or ListBox WebControl's Items
collection to find a certain item via text, we can also make use of the
DropDownList/ListBox 's Items Collection, it's an instance of the
System.Web.UI.ListItemCollection class which has the following two methods:

#ListItemCollection.FindByText Method
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIWebContro
lsListItemCollectionClassFindByTextTopic.asp?frame=true

#ListItemCollection.FindByValue Method
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemWebUIWebContro
lsListItemCollectionClassFindByValueTopic.asp?frame=true

I believe they'll be helpful to you. Thank.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi Richard,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
R

Richard

I did it throu an other way by looping throu al records, i am unclear if
this is the best way but it worked for me.

Dim intID As Integer
Dim iLoop as Integer
Dim dt as DataTable = ddlDataSet.Tables("tbl_Filiaal")
For iLoop = 0 to dt.Rows.Count - 1
If F_ID = dt.Rows(iLoop)("F_ID").ToString() then
intID = iLoop
exit for
End If
Next iLoop
lbFiliaal.SelectedIndex = intID

and sorry for my late answer.

thx for your help

Richard
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top