Value from one column but not another
Hello all,
I coded a simple application that selects two columns of data from a database into a datagridview. I also made it so that when you double click a row of data, it will open a messagebox and display the value of the particular cell that was clicked on in the grid, such as below:
http://farm8.staticflickr.com/7212/7...60a2e2e9_z.jpg
That is exactly what I want it to do.
What I do not want it to do is do that for the "Description" column. I only want it to pull the value from the "Code" column.
The purpose of this event will be to open another dialog that displays more information about the particular "Code" that was double clicked, not description. I do not want anything to happen by double clicking "Description"
Thanks for your help and let me know if you need more information.
Re: Value from one column but not another
How are you currently handling the mouse clicks? If you're handling them though the MouseDoubleClick event, I'm willing to bet there's a way to do it there. The MouseEventArgs parameter will give you the location of the mouse click relative to the top-left of the grid control. From there, you can figure out which column is being clicked.
Would you mind posting the code where you handle the mouse click? Maybe then I could help a bit more.