Professional Web Applications Themes

Binded DropDown list - ASP.NET General

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

  1. #1

    Default Binded DropDown list

    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 Guest

  2. #2

    Default Re: Binded DropDown list

    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" <mira.vizjak1guest.arnes.si> wrote in message
    news:bf1qbl$jf9$1planja.arnes.si...
    > 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 Guest

  3. #3

    Default Re: Binded DropDown list

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

    "Mira Vizjak" <mira.vizjak1guest.arnes.si> wrote in message
    news:bf2t75$hda$1planja.arnes.si...
    > Yes, I do fill drop down every time on PageLoad, otherwise the datagrid is
    > empty on postback.
    >
    >

    Anatoly Guest

  4. #4

    Default Re: Binded DropDown list

    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 Guest

  5. #5

    Default Re: Binded DropDown list

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

    "Mira Vizjak" <mira.vizjak1guest.arnes.si> wrote in message
    news:bf33em$me0$1planja.arnes.si...
    > 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 Guest

Similar Threads

  1. Question dropdown list not firing
    By vmchase in forum Brainstorming Area
    Replies: 0
    Last Post: February 2nd, 02:08 PM
  2. Dropdown list
    By Tapiwa JONGWE in forum Macromedia Director Lingo
    Replies: 5
    Last Post: July 6th, 12:45 PM
  3. Tool Tip for DropDown list
    By Naveen in forum ASP.NET Building Controls
    Replies: 1
    Last Post: September 6th, 05:55 AM
  4. dropdown list can't selected.
    By lucy in forum ASP.NET General
    Replies: 0
    Last Post: August 5th, 07:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139