Ticket Q429921
Visible to All Users

How to sort Field Chooser on CustomizationWindow

created 12 years ago

We are currently using your AspxGridView extensively as well as Customization Window to allow user to drag and drop desired columns to and from gridview. The problem we have is that Field Chooser Customization Window always sorts columns alphabetically in ascending order but we like to sort them in custom order.

I will try try to explain it with examples. I have following columns in Gridview

<dx:GridViewDataColumn FieldName="banana" VisibleIndex="1" Visible="true">
<dx:GridViewDataColumn FieldName="apple" VisibleIndex="2" Visible="true">
<dx:GridViewDataColumn FieldName="orange" VisibleIndex="3" Visible="false">
<dx:GridViewDataColumn FieldName="strawberry" VisibleIndex="4" Visible="false">
<dx:GridViewDataColumn FieldName="lemon" VisibleIndex="5" Visible="false">

When I run our application, it displays 'banana' and 'apple' in GridView and when I click customization window, Field chooser popped up and shows lemon, orange, strawberry. It is sorted alphabetically in ascending order.

What we like to do is that we like to have full control over Field Chooser customization window in terms of sorting. We have a table which stores serial number with column name for ordering column names. For example

banana has serial number 1
apple has serial number 2
orange has serial number 3
strawberry has serial number 4
lemon has serial number 5

Then, I like to display banana and apple get displayed in GridView and orange, strawberry, lemon get showed on Field chooser customization window based on serial number stored in a table. Orange gets displayed first since serial number is 3, strawberry next and lemon last.

I usually add/remove columns from code behind. Is there any way of doing this? I think I saw similar post dated few years back and reply was to add this kind of functionality on next release.

Thank you

Answers

created 12 years ago (modified 12 years ago)

Hello Gary,
By design, ASPxGridView orders columns in CustomizationWindow based on a column's caption. ASPxGridView does not allow for changes to column order in CustomizationWindow.

    Comments (1)
    DevExpress Support Team 10 years ago

      Hello,

      As a workaround, you can use the approach suggested in the ASPxGridView - How to sort the columns placed in the CustomizationWindow based on their visible index thread to change the order of columns in the CustomizationWindow.

      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.