James,
There is no event to do this with the DataGrid. What you could do is
check the DataView that the grid is bound to at the time you show the
context menu, and then modify it before you show it based on that value. If
the processing is too intensive for that, then I would look at extending the
DataGrid class and handling the windows message for clicking on the
datagrid. If you get a button click, then check to see if it is on a
header, and then check the sort property before and after.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
<an*******@discussions.microsoft.com> wrote in message
news:00****************************@phx.gbl...
Is there an event that is invoked when a user sorts a
column in a Windows Forms DataGrid?
I have context senstive icons that are enabled\disabled
depending upon the selected item in the datagrid. When I
sort the datagrid the selected item changes. I can not
find the event that is fired when the sorting occurrs
therfore I cannot enable\disable the icons
Thanks in advance,
James