Visual C#, Get selected text from current cell in DataGridView, bye pass default context menu
Posted on 2009-05-11
I am Developing a Windows Application in VS 2008 using C#. I am using DataGridView to allow users to add comments and instructions in multiple rows. and I want to know;
1. Is there any way to get selected text from current cell, e.g. "how are you doing" is a given text in a cell and user selected only word "doing". how to retrieve it programmatically.
2. how can we get the complete word on which click is made by user, e.g. "how are you doing" is a text in cell and user click anywhere/any character on/of "doing" and we get the word "doing" as result.
3. How we can bye-pass default context menu which appears on Right click when Cell is in edit mode, i want to replace that menu with my own options.
thanks in advance,