C#: Data Grid View Advanced Operations
I am developing a windows form application in C#. I have a datagridview on wi开发者_Python百科ndows form. This datagridview is poupulated dynamically, through some text file. Now what i want to achieve the following functionaity
1) Normally, when user clicks on my datagridview then the respected cell is selceted i want to remove this functionality.i.e if user click anywhere on my datagridview then noting will happens
2) Along with this datagridview i also have a menu strip in my form, the second thing which i want to achieve is that when user click on a specific button (say B) then my mouse cursor changes to plus shape(+) and it allows user to draw a box on my datagridview. On the basis of which i later perform some calculation.
Since i am new to .net thats why i don't know how to acheive this. So reference to some tutorial will also work.
You first part of the question can be done by
dataGridView1.Enabled = false;
dataGridView1.CurrentCell = null;
Can you elaborate a bit more on the second
For the 1 problem you have said, write the following line of code in Selected index changed event grid.Selectedindex=-1;
精彩评论