Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to give links to my datagridview items...so when i click on any item in a row it should fire click event.can anyone post any simple code for it.Thank you!
Posted
Updated 17-Feb-14 4:22am
v2
Comments
_Zorro_ 17-Feb-14 10:26am    
I don't think you will find an example without explaining what have you tried first.
Btw, windows forms / web forms?
Abhinav Chaudhary 18-Feb-14 7:28am    
In windows forms
What have you tried?
Abhinav Chaudhary 18-Feb-14 7:28am    
nothing...i don't have any idea about it...but i required it into my project

If you just want to hook into clicking on a cell, then you would handle the CellClick[^] method. If, however, you want to convert each item into the equivalent of a hyperlink, you would want to modify the CellTemplate[^].
 
Share this answer
 
Comments
Abhinav Chaudhary 18-Feb-14 7:36am    
Thank you....and can i link it with another datagridview table?
GridView has certain functionality like TemplateFiels, BoundFiled etc in Columns. So you can provide whatever controls you want in these fields.

So I'd suggest you to take a deep look at this given example[^].

-KR
 
Share this answer
 
Comments
Abhinav Chaudhary 18-Feb-14 11:54am    
Thank you sir!
Krunal Rohit 18-Feb-14 11:55am    
Glad I could help. And by the way I'm a student not a sir :)

-KR

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