The column chooser window seems to open as a modeless, top-level popup. It is a bit of a frustration since I might launch a modal dialog and, if the user happens to have the column chooser popup it will actually overlay my unrelated modal dialogs.
Are there any solutions? I could sprinkle in a method call that closes the column chooser (if open) but this would need to happen for every modal dialog that might open.
I'm investigating the style for the ColumnChooserDialog but I don't see what I might change there to fix the problem. I'm also looking at the XamGrid's ColumnChooserSettings which doesn't have anything for me either.
I think I want a very simple solution if possible. For example, just making the column chooser into a modal window during the "ShowColumnChooser()" method call would be nice. Or find a way have it hide itself when it loses focus? Hopefully someone has an idea for me.
Hello dbeavon,
Thank you for your post.
I have been investigating this issue, and while I haven't been able to reproduce the column chooser dialog being displayed over newly-opened modal dialogs, I do have a method for you that allows the column chooser to become a modal window after making the call to ShowColumnChooser(). This involves modifying the template of the ColumnChooserDialog style and including it in your project. One of the first elements of this template is a Popup. I would recommend removing this Popup in favor of a XamDialogWindow, as these can be made modal.
You may also opt to remove the Grid that represents the header of the original Popup in the template, which also contains the close button for the ColumnChooserDialog. If you do opt to do this and use the close button on the XamDialogWindow instead, please take note that you will want to call HideColumnChooser() prior to ShowColumnChooser() when opening the column chooser programmatically. The reason for this is because the button that is in the original header of the Popup notifies the xamGrid that the column chooser has been closed.
I have attached a sample project to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks for the example I'll take a look.
I saw that I accidentally posted this in the Silverlight control forum for xamGrid and I'm actually a WPF developer. But I trust the same strategy is possible for both. Rest assured, I'm not going to make that mistake again...
If I can convert this to WPF in as nice of a package as you created, I'll upload that too.
Thanks for all the additional time you've spent on this. I really appreciate it.
I assume that by "listen for when your other windows open" you mean to attach event handlers to all my other windows (eg modal dialogs) that will close the column chooser.
I think it is a good brute-force approach but I really wish I could just make the column chooser modal. That would make everything a lot simpler than it is now.
It is odd that popups in wpf are top-level and show over the top of modal dialogs. That seems all-around problematic. I wonder if here is a way to adjust that default behavior... Maybe this is an easier thing for me to play with.
Thanks again, David
I have been investigating this in WPF, and I have been able to reproduce everything you've described in your most recent post. Using the visual tree inspection program known as Snoop, I see that the XamDialogWindow has been instantiated, but it has an ActualWidth and ActualHeight of 0. This doesn't appear to be simply a XamDialogWindow issue primarily though, as simply removing the x:Name="Popup" from the Popup in the original template causes the same issue. If you give the XamDialogWindow an x:Name of "Popup", you still do not see it though. This told me that there is something internal to the control that is looking for a Popup element named "Popup," but only for the WPF side of things.
I went looking through the source code of the XamGrid and found that in the ColumnChooserDialog class there is a WPF specific part that looks for the Popup by name. If this Popup is not found, the ColumnChooserDialog never hits the EnsureLocation method, which is what measures and arranges the column chooser in the XamGrid. This is unexpected behavior, and I have asked our engineering staff to examine it further. To ensure that it receives attention, I have logged this issue in our internal tracking system with a development ID of 203808. I have also created a case for you on this matter so that you can track the information about this development issue. This case has an ID of CAS-158743-X8W9K1 and you can access it here: https://es.infragistics.com/my-account/support-activity. For the time being, as a workaround, I would recommend that you listen for when your other windows open, and when they do, you can call the XamGrid.HideColumnChooser() to hide the XamGrid's column chooser when your other windows open.
Regarding the column chooser showing up over other WPF dialog windows, this appears to be expected behavior. The column chooser on the XamGrid is a Popup, and if you open up a Popup in WPF and try to open another modal window, you will see that the popup will show over the top of that modal window.
Andrew,
I'm sorry but I'm stumped. It was easy enough to convert what you have to WPF but I'm not able to make the column chooser dialog visible (if I exchange the Popup in the ControlTemplate for a XamDialogWindow as you did). It is always invisible on the screen although I know it is instantiated in memory because its events all fire as I expect (Loaded, etc).
The structure of the XamGrid in WPF is really hard to grok. I see that my stuff is loaded somewhere as a visual child of a Primitives.RowsPanel but it must be underneath the other stuff or otherwise suppressed in some way. I tried messing with Zorder and Visibility properties of the children of RowsPanel but nothing is working.
If you think it wouldn't be too hard and if you have some more time to try this on the WPF side of things I would appreciate it.
I wish this was more easy to make the column chooser modal. BTW, maybe in retrospect given that I was talking about WPF (not Silverlight) you can confirm the original fact that the columnchooser shows up in front of normal wpf dialog windows (eg. even MessageBox.ShowDialog). Hopefully you agree that this isn't ideal and you see how I might want to avoid that.