Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make button visibbe if gridview contains > 0 rows 1

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
0
0
GB
Hi

Nice easy question I hope

I want to make a button visible or not depending if there are any rows in a gridview. I've got the following bit of code in page load but it only works on the second refresh of the screen for some reason. Needs to go in different event maybe?
Code:
        if (this.GridView2.Rows.Count > 0)
            this.btnPrint.Visible = true;
        else
            this.btnPrint.Visible = false;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top