If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

XtraGrid.GridControl Layout issues

Hey all,

I have a problem where I have a form and on load of this form i use an xml file to load my original layout. This sorts by priority and finished by dates.
Then on close i save the layout that they had on close and that is the next default.

What i want to do is be able to know when they use the right click context menu to select clear sorting. If i could detect that i would set the layout to having priority and finished by and save that to the xml. However the only way i know of doing this is look at the Layout event that is called whenever it changes and check if the layout is nothing. I cannot find a way of getting the layout from the gridControl either and therefore this method doesnt work.

So basically to summarise, I am either looking for an event that gets fired when the clear sorting is done from within that context menu
OR a way of checking whether the grid layout is no sorting and therefore has just been cleared. Either of these would be awesome.

Fixed. There is a GridView_GridMenuItemClick Event that is fired when you use the context menu. Then you can test
if (e.MenuType != GridMenuType.Column || e.DXMenuItem.Tag.ToString() != "MenuColumnClearSorting") return;
This allows you to only do your method when they are using clear sort.