Avatar of javierpdx
javierpdxFlag for United States of America

asked on 

Form View edit issues with DataItemCount and DataBind()

I tried to check a Form View to see if it had DataItemCount at load but it always came back false.

if (fvPetitionStatus.DataItemCount == 0)
       {
          pnlAddPetitionStatus.Visible = true;
       }
else
       {
           pnlAddPetitionStatus.Visible = false;
       }

Open in new window


I read that I could do a databind first so I used fvPetitionStatus.DataBind(); on page load prior to checking for the DataItemCount.

Then after after adding the databind, I had problems with editing the form view data through the aspx page.  When I don't use the databind, the form Form View object is editable without any issues.  

I'm using Linq to connect to SQL 2012 and c#.  Also running Visual Studio 2012.

Thank you for looking at this.
C#.NET ProgrammingWeb Development

Avatar of undefined
Last Comment
Naitik Gamit
ASKER CERTIFIED SOLUTION
Avatar of Naitik Gamit
Naitik Gamit
Flag of India image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of javierpdx
javierpdx
Flag of United States of America image

ASKER

Thank you.  This was a  big help.
Avatar of Naitik Gamit
Naitik Gamit
Flag of India image

You Welcome.
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo