Loading ListBox Data on Load

A

Amy Snyder

Below is my code when loading my page. Is there a way to perform
conditions based on another field when loading? I want all items that
have a field name of level=2 indented a few spaces.

With lstIndustry
.DataValueField = "code"
.DataTextField = "desc"
.DataSource = GetDataSet("s_select_my_sp")
.DataBind()
End With

Thanks
 
M

Michael Ramey

I don't believe so, and still be able to use the DataSource property.

You can do many things to accomplish this though. How about writing a
function to loop through all the rows of the dataset, and make calls to
lstIndustry.Items.Add(new
ListItem(functionToReturnWhatIWant(<dataset_textfield>, <dataset_level>),
<dataset_value>))

HTH,
--Michael
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top