Solved

Disable Button in Gridview Footer is Criteria Is Met

Posted on 2009-05-17
4
313 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
4 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 250 total points
ID: 24407748
0
 
LVL 11

Assisted Solution

by:Muhammad Ousama Ghazali
Muhammad Ousama Ghazali earned 250 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

12 Experts available now in Live!

Get 1:1 Help Now