Connecting Tech Pros Worldwide Forums | Help | Site Map

How to use cellclick event for datagridview in c# in vs2005?

Newbie
 
Join Date: Jan 2008
Posts: 12
#1: Nov 21 '08
Hi to All,
How to use mouse click event for datagridview in c# in vs2005?
I m using datagridview in c# application.I had bound data in datagridview.I want to display data in textbox when i click on appropriate row of the datagridview.Grid has only one event "cellcontentclick" is displayed.But i want to use "cellclick" or "selectionchanged" event of datagridview.
So plz help me...How to do this....?
Thax in advance.......

Member
 
Join Date: Jul 2008
Posts: 36
#2: Nov 21 '08

re: How to use cellclick event for datagridview in c# in vs2005?


What are you talking about? DataGridView has lots of events for clicks, at least:
  • CellClick
  • CellContentClick
  • CellContentDoubleClick
  • CellDoubleClick
  • CellMouseClick
  • CellMouseDoubleClick

I don't know the difference between CellClick and CellMouseClick other than with CellMouseClick you can check the mouse button the click was made. CellContentClick tells that the click was on the content (i.e. the text), not on the empty space around it.
Newbie
 
Join Date: Jan 2008
Posts: 12
#3: Nov 21 '08

re: How to use cellclick event for datagridview in c# in vs2005?


Hi,
I want to get data in textbox when i click on cell of datagridview.It may be any event Cellclick or Mouseclick.Bcoz there is only one event displayed in the application. So how to use another event in C# application?
So plz help me....
Reply