Solved

Checking the gridview status in asp.net 2.0

Posted on 2007-11-27
2
198 Views
Last Modified: 2013-11-07
Upon the page_load event, I just need to check if the gridview actually populated with anything. Assuming my gridview is named GridView1, what would be the code for this?
0
Comment
Question by:jumpstart0321
2 Comments
 
LVL 22

Accepted Solution

by:
RedKelvin earned 500 total points
ID: 20362734
Hi there,

It is as simple as checking if there are any rows, like this

    If Me.GridView1.Rows.Count > 0 Then
      'Rows exist
    End If


or in C#

    If (this.GridView1.Rows.Count > 0)
   {
      //Rows exist
    }

RedK
0
 

Author Comment

by:jumpstart0321
ID: 20362736
Thanks, I knew it was simple... I just couldn't figure it out:)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now