How do I change formview mode to insert, if on page load, there’s no data to bind (ASP.NET C#)

In pseudo code this is what I’m trying to do, but can’t get it to work.

Pseudo code:
If (formview1 = null)
{
formview1.mode = insertMode;
}

Can someone help me with this?

Thanks!
bmanmike39Asked:
Who is Participating?
 
CmdoProg2Connect With a Mentor Commented:
Opps,  didn't include the condition
if (formview1.DataItemCount == 0)
      {
        formview1.ChangeMode(FormViewMode.Insert);
      }

Open in new window

0
 
CmdoProg2Commented:
formview1.ChangeMode(FormViewMode.Insert);
0
 
bmanmike39Author Commented:
Thanks!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.