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
696 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add different cell to otherwise similiar row 4 39
Question about JQuery and asp.net 3 27
DataTables + iCheck + pagination Issue 2 23
Linq asp.net mvc 13 10
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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