We would like to allow users to hide columns using the Column Chooser dialog, but prevent them from hiding them by dragging them outside the grid. We don't want to disable dragging entirely, since we want to allow users to reposition columns or drag them to the "Group By" box.
Currently, a column can be dragged completely outside our application to, say, Internet Explorer. The cursor at that point shows the column header with an X in it. If the user releases the mouse button, the column is hidden.
I can't figure out a good way of preventing this from happening. There doesn't appear to be an "EndDrag" type of method that would allow me to cancel the dragging, and the BeforeColPosChanged event doesn't appear to distinguish between columns hidden using the Column Chooser and columns hidden by dragging. Ideally, I would like to turn off the "hide by dragging" feature entirely.
We are using 2007 Volume 1.
Any suggestions?
Thanks,
Dan Watts
Hi Dan,
That doesn't sounds right to me. You should not be able to hide a column by dargging it outside the grid. Does this only happen when the ColumnChooser is displayed or does it happen all the time? What version of the grid are you using?
You might want to Submit an incident to Infragistics Developer Support. This sounds like a bug to me.
Hi Mike,
The problem occurs all the time with this particular grid, which has the "RowSelectorHeaderStyle.ColumnChooserButton" option set. It doesn't occur with other grids that don't use this option.
I don't think it's a bug since it is documented in the "Column Chooser" section of the help file:
A column can be dragged and dropped outside of the WinGrid control to hide it. This follows the Microsoft Outlook behavior. Note that the WinGrid allows the user to do this only if it can determine that the user interface for Column Chooser dialog box is available. It determines that the Column Chooser dialog box is available if one of the following conditions is true:
I've attached a screenshot that shows the grid layout and what happens when I drag the "Program" column header over Internet Explorer. (For some reason the screen capture utility is omitting the "X" which overlays the column header cursor when the column is dragged over Internet Explorer, but trust me, it's there!)
We are using NetAdvantage for .NET 2007 Volume 1 CLR 2.0.Thanks,
Dan.
I had the same problem and setting that property fixed to for me also...thanks.
I set ultraGrid.DisplayLayout.ColumnChooserEnabled to DefaultableBoolean.False and get the needed behavior. The user can't hide a column by dragging and droping it outside the application. At the same time the user can change columns order, group by column or show/hide columns with the help of our custom column shooser dialog.
The custom column chooser dialog uses the UltraGridColumnChooser control. We show it when a special button from the tooolbar is clicked.