FindByText not working

T

tshad

I have a dropdown that gives me an error when I do a FindByText, such as:

Dim temp as ListItem = JobTitles.Items.FindByText("BarTender")
temp.Selected = True

or

JobTitles.Items.FindByValue("BarTender").Selected = True

I get the error:

Object reference not set to an instance of an object.

I know the value is there.

Why doesn't this work?

Thanks,

Tom
 
T

tshad

Figured it out:

Dim Temp as ListItem = JobTitles.Items.FindByText("BARTENDER")
if not IsNothing(Temp) then
Temp.Selected = True
end if

But is there a way to tell it to ignore case?

Thanks,

Tom
 

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,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top