Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Loading ListBox Data on Load

Reply
Thread Tools

Loading ListBox Data on Load

 
 
Amy Snyder
Guest
Posts: n/a
 
      01-29-2004
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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Michael Ramey
Guest
Posts: n/a
 
      01-29-2004
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_textfi eld>, <dataset_level>),
<dataset_value>))

HTH,
--Michael

"Amy Snyder" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox selection to populate another listbox? Chris Kettenbach ASP .Net 3 06-16-2005 09:19 PM
Listbox item added with client scripts not submitting with ASP:Listbox Simon Prince ASP .Net 2 10-19-2004 04:11 PM
How do I move all items in a listbox to another listbox kent ASP .Net 1 05-03-2004 12:17 AM
click listbox and refresh another listbox DC Gringo ASP .Net 0 04-06-2004 02:13 AM
Re: now desparate! - 1st listbox contents disappears when 2nd listbox appears? blenderdude ASP .Net 0 08-03-2003 10:18 PM



Advertisments