Disable Button in Gridview Footer is Criteria Is Met

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
acancelAsked:
Who is Participating?
 
cdaly33Connect With a Mentor Commented:
0
 
cdaly33Commented:
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
 
Muhammad Ousama GhazaliConnect With a Mentor Solution Analyst & ArchitectCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.