Formview dropdownlist won't populate in insert mode, but does in edit mode ???

Discussion in 'ASP .Net Web Controls' started by jobs at webdos, Oct 9, 2006.

  1. I have a formview that will either edit or insert records into a
    database. when I call the page with a query string ?x= its goes to edit
    mode and loads data from a datasource in the form and load data into
    the dropdown (from another datasource) with no problem.

    I'm using the same dropdownlist tag for both edit and insert, however
    the dropdown only get populated in insert mode...

    <asp:DropDownList ID="RouteCodeList" runat="server" SelectedValue='<%#
    Bind("routeCode") %>' DataTextField="routeCode" DatasourceID=
    "SQLRouteCodes">

    </asp:DropDownList><br />



    I've tried adding AppendDataBoundItems=true , and have tried replacing
    the selectedvalue with ="", in insert mode it simply does not load the
    entries.



    Also, I've tried loading entries using findcontrol, but that gives me
    an instance error tell me I need to specify new. I've tried Item(0) and
    row..

    CType(RateFormView.FindControl("RouteCodeList"),
    DropDownList).Items.Add("xxx")

    Anybody, starting a formview in insert mode and populating a dropdown
    beforehand? How?



    Thanks.
     
    jobs at webdos, Oct 9, 2006
    #1
    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. jobs at webdos
    Replies:
    0
    Views:
    723
    jobs at webdos
    Oct 9, 2006
  2. =?Utf-8?B?QW5u?=

    Formview template insert to edit mode

    =?Utf-8?B?QW5u?=, Apr 30, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    486
    Jon Paal [MSMD]
    May 1, 2007
  3. mkidd
    Replies:
    2
    Views:
    1,030
    mkidd
    Jan 15, 2008
  4. Satish
    Replies:
    8
    Views:
    9,734
    Satish
    Mar 31, 2008
  5. Steve Myers
    Replies:
    2
    Views:
    294
    Steve Myers
    Nov 20, 2003
Loading...

Share This Page