I am trying to create a click event for a DataGridView column headers so that when the user clicks to reorder the data I can run code to draw the gantt chart in the new order (see screen shot below).
As you can see I want the user to be able to sort the datagridview and the gantt chart to respond to the re-ordering.
I have tried using the click event as per msdn, however this had no effect when i tested it: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.columnheadermouseclick.aspx
private void dataCapPlan_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
MessageBox.Show("OK");
}
for DataGridView dataCapPlan
Any Ideas?
Much Appreciated!
Needed to add code:
dataCapPlan.ColumnHeaderMouseClick +=new DataGridViewCellMouseEventHandler(dataCapPlan_ColumnHeaderMouseClick);