Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Disable Button in Gridview Footer is Criteria Is Met

Posted on 2009-05-17
4
Medium Priority
?
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

704 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