Suppose I have a GridView on the page. GridView has edit column enabled and is showing some records. How can I enable/disable edit in rows based on other fields of data?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do this in a number of ways. Two of these are:
First convert the edit column to a template field.
Whatever field you want to base the enable/disable on you can add the the GridView’s DataKeyNames property.
Then on the OnRowDataBound event you can do the following:
Or,
In the Html markup of you aspx page, edit the linkbutton enabled property to bind the your desired field. Such as:
Hope that helps.