Hello, we have a column chooser on the grid. When select columns, some are mingled in the existing columns making it more difficult for a user to find the newly selected columns. I wonder how to have new columns selected by user always added to the end of the columns displayed. Thanks !
Hi,
I'm having a hard time understanding your question.
It sounds like you are saying that when the user clicks the checkbox on a column in the ColumnChooser, you want that column to always go to the end, instead of appearing where it was previously located.
If that's what you want, then I think it should be easy to accomplish by handling the BeforeColPosChanged event. Something like this:
private void ultraGrid1_BeforeColPosChanged(object sender, BeforeColPosChangedEventArgs e) { if (e.PosChanged == PosChanged.HiddenStateChanged) { foreach (Infragistics.Win.UltraWinGrid.ColumnHeader header in e.ColumnHeaders) { if (header.Column.Hidden == false) { header.VisiblePosition = 999; } } } }
I used 999 here, because I figure that will always be higher than the VisiblePosition on any of the other columns in the grid. But just to be safe, it might be better to loop through the existing columns in the grid and find the highest VisiblePosition and then add 1 to it. My code seemed to work okay in the brief testing I did, though.
Hi Mike,
I need an information about ColumnChooser. I need a checkbox in the header of the columnchooser to select all the columns or deselect all. Is it possible? I tried to the following code which i handled for a grid.
e.Layout.Bands(0).Columns(0).Header.CheckBoxVisibility = HeaderCheckBoxVisibility.WhenUsingCheckEditor
This is working in grid fine, but not not in column chooser. What i have to do? whether i am missing anything? Please guide me.
Hi Suresh,
There's is currently no support for this in the Column chooser, but it's a popular feature request. I encourage you to Submit a feature request to Infragistics.
Feature for each volume release are chosen in part based on the number of requests from customers. So the more people who ask for a feature, the more likely it is to get implemented. :)
Thank for your reply Mike.
For the meantime i placed a checkbox above the Columnchooser and handled it. Select All and Deselection using that header checkbox is working fine. Now i want to change the checkedstate of header checkbox based on the columns selected in the Column Chooser (If i select/deselect single/set of column(s), then i have to change the checkedstate of header checkbox as intermediate. If all column deselected, i have to change the checkedstate as uncheked. If i select all columns in the column chooser, i have to change the checkedstate as checked). In what event of Columnchooser i have to handle this?
I don't think there is an event on the ColumnChooser that you can use for this. But you can use the AfterColPosChanged event of the grid. The veent args will tell you if a column is being hidden (or unhidden).