Solved

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

Posted on 2010-11-18
3
709 Views
Last Modified: 2013-12-17
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!
0
Comment
Question by:bmanmike39
  • 2
3 Comments
 
LVL 12

Expert Comment

by:CmdoProg2
ID: 34165269
formview1.ChangeMode(FormViewMode.Insert);
0
 
LVL 12

Accepted Solution

by:
CmdoProg2 earned 500 total points
ID: 34165308
Opps,  didn't include the condition
if (formview1.DataItemCount == 0)
      {
        formview1.ChangeMode(FormViewMode.Insert);
      }

Open in new window

0
 

Author Closing Comment

by:bmanmike39
ID: 34166039
Thanks!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question