Have you read the docs on the cell object, row object, row collection and the click events associated with the header?
YOu can't expect anyone to remeber deep detail when controls in WInforms have 10,000+ events and thousands of properties and object collections.
Always start by reading the documentation. I skim the controls methods, events and properties just get oriented to the control and how behaves. This is why I suggested learning the object model for WinFOrms.
So I did what you should have done first. I looked up the DGV even though I have used it a thousand times. The issue would have been obvious if you looked up the control and tried to understand how it works.
I am not trying to give you a hard time. I am trying to show you how we programmers and software engineers proceed with any new system that we have to work with. We always start by reviewing the documentation. I have learnhed hundreds of systems because I have learned to read the documentation. It has saved me, likely, tens of thousands of hours over guessing and copying and fudging around.
All you have to do is right click on hte control in the toolbox and select "MSDN Help" on the menu, which will take you to the documentation for the selected control.
Also consider that your question was arbitrary which it wouldn't have been if you had read the document on the control. You can't expect people you ask to do all of the work, after alll, it is your project.
Here is one hint at the first step that you can try to do whatever it is you want to accomplish which is still quite vague in my opinion.
$datagridview1_ColumnHeaderMouseClick=[System.Windows.Forms.DataGridViewCellMouseEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.DataGridViewCellMouseEventArgs]
}