how to disable copy paste of action column in grid view

Sunny Sharma 1 Reputation point
2022-10-17T10:28:47.74+00:00

We are developing a Winform app and have a requirement to enable copy paste entire data in grid view including the header column which is working fine. The only issue we are getting is while copy pasting it's also including the first action empty column which is not needed. I have attached the screenshot. Could anyone please tell whether it's possible to remove the blank action column from the Grid view while copy pasting.
251093-screenshot-1.png

Developer technologies Windows Forms
Developer technologies .NET Other
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Yas 156 Reputation points
    2022-10-18T00:05:18.897+00:00

    Hi Sunny,

    What you need to do is to disable the row header by following these steps:

    • Get the properties of your GridView
    • Navigate to the RowHeadersVisible settings and set it to False

    Or via code:

       csharp  
       this.dataGridView1.RowHeadersVisible=false;  
    

    Hope this helps


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.