I am having a gridview in asp.net and now I want the cell value by the column name but not by the cell index.
How would be it possible by retrieving the cell value by the cell column name
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.
GridViewdoes not act as column names, as that’s it’sdatasourceproperty to know those things.If you still need to know the index given a column name, then you can create a helper method to do this as the
gridviewHeader normally contains this information.remember that the code above will use a
BoundField… then use it like:I would strongly suggest that you use the
TemplateFieldto have your own controls, then it’s easier to grab those controls like:and then use