Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable Button in Gridview Footer is Criteria Is Met

Posted on 2009-05-17
4
Medium Priority
?
322 Views
Last Modified: 2012-05-07
Gurus
I am trying to disable a button in the footer of my gridview depending if the user has exceeded his number of requests.

Example, If UserRequests >= UserRequestAllotted then
    me.btn_Create_Requests.enabled = False
End if
0
Comment
Question by:acancel
  • 2
3 Comments
 
LVL 9

Expert Comment

by:cdaly33
ID: 24407746
In the gridview's databound event check the rowtype and when it is footer then find the button in the footer and modify it as needed.
0
 
LVL 9

Accepted Solution

by:
cdaly33 earned 1000 total points
ID: 24407748
0
 
LVL 11

Assisted Solution

by:Muhammad Ousama Ghazali
Muhammad Ousama Ghazali earned 1000 total points
ID: 24407803
Use the code in snippet below in the RowDataBound event of GridView if the code on the above provided link confuses you:
if (e.Row.RowType == DataControlRowType.Footer)
{
	((Button)e.Row.Cells(0).FindControl("btnDoSomething")).Enabled = false;
}

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Integration Management Part 2
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

824 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