Binded DropDown list

Ask a Question related to ASP.NET General, Design and Development.

  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. Similar Questions and Discussions

    1. Dropdown list
      I would like to display 15 items (lines) in the dropdown list, but by default the list displays only 11 lines. How can I have all the 15 items...
    2. DataGrid with Dropdown list
      Any Help is appreciated! I have a datagrid with Drop down list and a remove hyperlink as two columns. When I remove the row of the datagrid by...
    3. Refresh dropdown list
      On a cfform I have a cfselect dropdown . The situtation is that when an option isn't listed I have a "Add button" next to the drop down that...
    4. Dropdown Property List??
      I'm writing an aspx server control and I need to have a property that displays a dropdown list of things I have in an arraylist. I'm trying to do...
    5. Tool Tip for DropDown list
      Hi, I have a dropwnlist of fixed width. The item names in the dropdown list are quite big. The Tooltip property for a dropdownlist control...
  3. #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.vizjak1@guest.arnes.si> wrote in message
    news:bf1qbl$jf9$1@planja.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

  4. #3

    Default Re: Binded DropDown list

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

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

    Anatoly Guest

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

  6. #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.vizjak1@guest.arnes.si> wrote in message
    news:bf33em$me0$1@planja.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

Posting Permissions

  • You may not post new threads
  • You may 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