Click here to Skip to main content
15,906,624 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
i am having a gridview in asp.net
and now I want the index value by the column name
How to do it.

for example
C#
productid   |  productname   |    Productcode  | edit  |  delete


when i write Edit it should give me its index value [3]

is this possible????

i tries to do this
C#
protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
      {
          string columnValue = ((Label)e.Row.FindControl("imgEdit")).Text;
      }

but it gives me error
"object reference not set to an instance of an object"





please help
Regards
Posted
Updated 11-Sep-13 19:53pm
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900