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
712 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Create a Dropdown list with sub group 10 43
SQL Server Serialization error 8 47
Using the .NET JSON Serializer to create a single string 6 58
Call to SQL server times out 5 55
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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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