Binded DropDown list

Discussion in 'ASP .Net' started by Mira Vizjak, Jul 15, 2003.

  1. Mira Vizjak

    Mira Vizjak Guest

    Hi
    I'm using a datagrid with a dropdown list in it. The dropdown list is filled
    with values from SQL database, it's autopostback property is set to true and
    when I select another item in it, the SelectedIndexChanged event fires
    properly, but I can't the index or value of the selected item. SelectedValue
    and SelectedItem is Nothing, Request.Params("DropDown1") is empty as well.
    Thanks for your help!

    Jure
     
    Mira Vizjak, Jul 15, 2003
    #1
    1. Advertising

  2. Mira Vizjak

    Anatoly Guest

    Please post some code snippet.
    Probably you fill dropdown every time, use IsPostBack property to fill it
    only first time you enter the page.
    Also check if EnableViewState of dropdown and page is set to true.


    "Mira Vizjak" <> wrote in message
    news:bf1qbl$jf9$...
    > Hi
    > I'm using a datagrid with a dropdown list in it. The dropdown list is

    filled
    > with values from SQL database, it's autopostback property is set to true

    and
    > when I select another item in it, the SelectedIndexChanged event fires
    > properly, but I can't the index or value of the selected item.

    SelectedValue
    > and SelectedItem is Nothing, Request.Params("DropDown1") is empty as well.
    > Thanks for your help!
    >
    > Jure
    >
    >
     
    Anatoly, Jul 16, 2003
    #2
    1. Advertising

  3. Mira Vizjak

    Anatoly Guest

    Sorry, can not see any connection between refill dropdown and empty Datagrid
    ???
    Please explain.

    "Mira Vizjak" <> wrote in message
    news:bf2t75$hda$...
    > Yes, I do fill drop down every time on PageLoad, otherwise the datagrid is
    > empty on postback.
    >
    >
     
    Anatoly, Jul 16, 2003
    #3
  4. Mira Vizjak

    Mira Vizjak Guest

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles MyBase.Load
    If Security.IsInRoles("Admins") = False Then
    Response.Redirect("default.aspx")
    End If
    If Page.IsPostBack=False then
    BindGrid()
    End If
    End Sub
    In this case when I select an item from ddl control the datagrid on the page
    posted back is empty.

    If Security.IsInRoles("Admins") = False Then
    Response.Redirect("default.aspx")
    End If
    BindGrid()
    End Sub
    In this case when I select an item from ddl control the datagrid on the page
    posted back is full.
     
    Mira Vizjak, Jul 16, 2003
    #4
  5. Mira Vizjak

    Anatoly Guest

    I can't see from code you post where do you fill the dropdown.
    Fill it once when Not IsPostBack.

    "Mira Vizjak" <> wrote in message
    news:bf33em$me0$...
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > If Security.IsInRoles("Admins") = False Then
    > Response.Redirect("default.aspx")
    > End If
    > If Page.IsPostBack=False then
    > BindGrid()
    > End If
    > End Sub
    > In this case when I select an item from ddl control the datagrid on the

    page
    > posted back is empty.
    >
    > If Security.IsInRoles("Admins") = False Then
    > Response.Redirect("default.aspx")
    > End If
    > BindGrid()
    > End Sub
    > In this case when I select an item from ddl control the datagrid on the

    page
    > posted back is full.
    >
    >
     
    Anatoly, Jul 16, 2003
    #5
    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. Amar

    How Determine Binded Column

    Amar, Feb 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    311
  2. Hunter Hou
    Replies:
    8
    Views:
    1,198
    AlesD
    Aug 10, 2004
  3. amirmi
    Replies:
    0
    Views:
    837
    amirmi
    Aug 1, 2006
  4. amirmi
    Replies:
    1
    Views:
    680
    nataliepea
    Sep 8, 2006
  5. amirmi
    Replies:
    0
    Views:
    633
    amirmi
    Aug 1, 2006
Loading...

Share This Page