Loading ListBox Data on Load

Discussion in 'ASP .Net' started by Amy Snyder, Jan 29, 2004.

  1. Amy Snyder

    Amy Snyder Guest

    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!
     
    Amy Snyder, Jan 29, 2004
    #1
    1. Advertising

  2. 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

    "Amy Snyder" <> wrote in message
    news:...
    > 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!
     
    Michael Ramey, Jan 29, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. blenderdude
    Replies:
    0
    Views:
    1,104
    blenderdude
    Aug 3, 2003
  2. DC Gringo
    Replies:
    0
    Views:
    413
    DC Gringo
    Apr 6, 2004
  3. kent
    Replies:
    1
    Views:
    894
    Andrew de la Harpe
    May 3, 2004
  4. Simon Prince
    Replies:
    2
    Views:
    3,355
    =?Utf-8?B?TWljaGFlbCBUYXlsb3I=?=
    Oct 19, 2004
  5. Chris Kettenbach

    Listbox selection to populate another listbox?

    Chris Kettenbach, Jun 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,661
    Chris Kettenbach
    Jun 16, 2005
Loading...

Share This Page