FormView.ChangeMode(FormViewMode.Edit) not working

Discussion in 'ASP .Net Web Controls' started by David Thielen, Mar 2, 2007.

  1. Hi;

    I have the following code:
    if (!IsPostBack)
    {
    if (MyPerson.Id == DbUtils.NULL_PK)
    formRegister.ChangeMode(FormViewMode.Insert);
    else
    formRegister.ChangeMode(FormViewMode.Edit);
    }

    For Insert it wors fine. For Edit it shows nothing in the FormView and the
    OnDataBound method is never called. I have a
    <EditItemTemplate>...</EditItemTemplate> block of html

    Any ideas?

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com

    Cubicle Wars - http://www.windwardreports.com/film.htm
    David Thielen, Mar 2, 2007
    #1
    1. Advertising

  2. Hi Dave,

    I cannot see any problem from your posted code. Would you please post a
    complete code listing that could reproduce the issue? Thanks.

    My first wild guess would be:

    1) The data binding code is never called
    2) To change to edit mode, the FormView will need a current record


    Regards,
    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    ==================================================
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    ==================================================

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], Mar 2, 2007
    #2
    1. Advertising

  3. It was itme (2) - stupid on my part. Thank you.

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com

    Cubicle Wars - http://www.windwardreports.com/film.htm




    "Walter Wang [MSFT]" wrote:

    > Hi Dave,
    >
    > I cannot see any problem from your posted code. Would you please post a
    > complete code listing that could reproduce the issue? Thanks.
    >
    > My first wild guess would be:
    >
    > 1) The data binding code is never called
    > 2) To change to edit mode, the FormView will need a current record
    >
    >
    > Regards,
    > Walter Wang (, remove 'online.')
    > Microsoft Online Community Support
    >
    > ==================================================
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    > ==================================================
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    >
    David Thielen, Mar 4, 2007
    #3
    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. J055
    Replies:
    1
    Views:
    12,040
    Walter Wang [MSFT]
    Aug 10, 2006
  2. Trev

    Formview ChangeMode Problem

    Trev, Feb 8, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    582
  3. J055
    Replies:
    5
    Views:
    726
    Walter Wang [MSFT]
    Aug 20, 2007
  4. R Bandeira
    Replies:
    0
    Views:
    402
    R Bandeira
    Sep 6, 2007
  5. rodchar

    formview changeMode

    rodchar, Dec 13, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    495
    rodchar
    Dec 17, 2007
Loading...

Share This Page