• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • 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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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