Hi,
I'm trying to make a context menu for a XamDataGrid, but specifically for the section where no rows are. So, if there are any other context menus, such as on the rows themselves or on the column headers (the visibility pane), then these context menus should remain unchanged. When I simply set a ig:ContextMenuService.Manager on the XamDataGrid, this will override the visibility pane on the column headers.
Regards, Stefan
Hello Stefan,
I am glad that you have found a solution to your issue. Please do not hesitate to let me know if you have any further question.
Hi Gergana,
Actually I don't want to open the fieldchooser from a context-menu (as I mentioned in my previous post). I want to open the fieldchooser with a single right mouseclick on the header, without the root context menu disturbing it. But, I have managed to solve this issue myself in the meanwhile. I solved it by creating a Style for the DataRecordPresenter and adding an EventSetter for the PreviewMouseRightButtonUp event. In the event handler, the record type is checked for HeaderRecord, and if so, the e.Handled is set to true (this is the crucial part because it prevents the root context menu from popping up). Finally, the FieldChooser is called manually just like in the post you referred to.
I have been looking into you post. If you want to open the FieldChooser from a ContextMenu I can suggest to take a look at the following link from our forum: http://ko.infragistics.com/community/forums/t/49813.aspx.
Please do not hesitate to let me know if you have any further questions on this matter.
Hello Gergana,
The root context menu and grid items context menu are correct. However, for the header it is the opposite that I want. I do *not* want to see any context menu, but the field chooser, as it normally would. The problem is that the root context menu overrides the field chooser, so it will not be shown. If you remove the header context menu you will see what I mean.
I have made a sample prototype project with classic (non-Infragistics) controls that illustrates what I need. If you right click the green area (empty area), you will see a root context menu. If you right click the blue area (rows area), you will see a row context-menu. If you right click the orange area, you will see the field chooser *without* any context menus interrupting (this is what it is all about).
Note: the orange area field chooser only works on the column headers for the actual columns. So, in order to see the field chooser, you should click one of the 2 first columns, not the 3rd (empty) column.
So, how can I do this with Infragistics?
I have been further researching your issue and have modified the sample application for you. I have added a new command, for the DataRecordPresenter. Then I check if the Record is of type HeaderRecord.
Please find the attached sample application and do not hesitate to let me know if you have any further questions on this matter.