FormView.ChangeMode(FormViewMode.Edit) not working

D

David Thielen

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
 
W

Walter Wang [MSFT]

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 ([email protected], 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top