Selecting the first item of a datalist

Discussion in 'ASP .Net Web Controls' started by Guest, Nov 17, 2003.

  1. Guest

    Guest Guest

    I have a datalist on my page. How can I select the first item of the
    datalist in loading page for the first time?
     
    Guest, Nov 17, 2003
    #1
    1. Advertising

  2. Guest

    Jos Guest

    wrote:
    > I have a datalist on my page. How can I select the first item of the
    > datalist in loading page for the first time?


    With Visual Basic:

    If(Not IsPostback) Then
    DataList1.DataSource= whatever
    DataList1.SelectedIndex=0
    DataList1.DataBind()
    End If

    --

    Jos
     
    Jos, Nov 17, 2003
    #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. Dirk Meusel
    Replies:
    1
    Views:
    3,032
    Dirk Meusel
    Aug 19, 2003
  2. Nevyn Twyll
    Replies:
    8
    Views:
    1,916
  3. Gert
    Replies:
    0
    Views:
    486
  4. Jeff

    Selecting item in DataList

    Jeff, Nov 3, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    386
  5. SStory
    Replies:
    1
    Views:
    153
    SStory
    Sep 22, 2003
Loading...

Share This Page