• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

Checking the gridview status in asp.net 2.0

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
jumpstart0321
Asked:
jumpstart0321
1 Solution
 
RedKelvinCommented:
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
 
jumpstart0321Author Commented:
Thanks, I knew it was simple... I just couldn't figure it out:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now