Ticket T534972
Visible to All Users

Focusing the newly added grid column in Column Chooser

created 8 years ago

hello,
i would like ask you for "nice to have" behaviour of listview.
in list view i would like to add new column, so i choose the columnchooser and then action "Add" . There i select the specify columns with checkboxes.
And the question is: is possible to scroll the cursor to new added row with column in basic list in column chooser?

I hope is it clear :)
Thansk you for your response
Jan

Show previous comments (3)

    Hello Dennis,
    Thank you for your reply. I asked our customers and they thought about this behaviour.
    When they choose several columns together, then scroll to first added row in column chooser .
    Thank you
    Jan

    Dennis Garavsky (DevExpress) 8 years ago

      Thanks for your feedback, Jan. We need some additional time to see if this scenario can be easily implemented in the current version, at least using custom code on your side.

        Thank. it isn't necessary for us, but it is category  "nice to have" for us customers.
        Thank you
        Jan

        Answers approved by DevExpress Support

        created 8 years ago (modified 7 years ago)

        Hello Jan,

        UPDATED:
        Starting with v17.1.5, focusing the newly added grid column in Column Chooser is enabled by default. So, you can remove the previous solution code from your project.
        ================
        In the current XAF version, you can add the following ViewController in the YourSolutionName.Module.Win project:

        C#
        using DevExpress.ExpressApp; using DevExpress.ExpressApp.DC; using DevExpress.ExpressApp.Model; using DevExpress.ExpressApp.Win.Editors; using DevExpress.XtraEditors.Customization; using DevExpress.XtraGrid.Columns; using DevExpress.XtraGrid.Views.Grid; using System.Linq; namespace MainDemo.Module.Win.Controllers { public class GridEditorColumnChooserController : DevExpress.ExpressApp.Win.SystemModule.GridEditorColumnChooserController { protected override GridListEditorColumnChooserExtender CreateColumnChooserExtenderCore() { GridListEditor gridEditor = ((ListView)View).Editor as GridListEditor; if(gridEditor != null && gridEditor.GridView != null) { return new MyGridListEditorColumnChooserExtender(((ListView)View).Model, gridEditor, ((ListView)View).ObjectTypeInfo, gridEditor.GridView); } return null; } } public class MyGridListEditorColumnChooserExtender : GridListEditorColumnChooserExtender { public MyGridListEditorColumnChooserExtender(IModelListView listViewModel, WinColumnsListEditor listEditor, ITypeInfo objectTypeInfo, GridView gridView) : base(listViewModel, listEditor, objectTypeInfo, gridView) { } protected override void AddColumnCore(string propertyName) { base.AddColumnCore(propertyName); GridColumn item = ((CustomizationListBoxBase)ActiveListBox).Items.OfType<GridColumn>().FirstOrDefault(c => (c.FieldName == propertyName || c.FieldName == propertyName + "!")); if(item != null) { ((CustomizationListBoxBase)ActiveListBox).SelectedItem = item; } } } }

        I am afraid there is no capability to select the first item in the list box in the current XAF version, so I am always focusing the last item. I hope this behavior meets your end-users too.

        We have not tested this example code under all scenarios supported by XAF, so feel free to modify and test it further to better meet your business requirements.

          Comments (3)

            Hello Dennis,

            Thank you for your solution. it works. I thin it is perfetct.
            Best regards
            Jan

            Dennis Garavsky (DevExpress) 8 years ago

              You're always welcome, Jan!

              Dennis Garavsky (DevExpress) 7 years ago

                @Jan: Starting with v17.1.5, focusing the newly added grid column in Column Chooser is enabled by default. So, you can remove the previous solution code from your project.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.