Ticket T811311
Visible to All Users

How to sort Kanban groups

created 6 years ago

Hey DX
I need some assistance and apologize if this has been posted before, but i have not found a suitable answer.

I have some data showing on the Kanban Tile View.
Each card has a priority linked to an enum

C#
public enum Priority { High = 1, Medium = 2, Low = 3 }

When looking at the kanban view, i need all cards with a 'High' priority to appear at the top of kanban view. This is easily accomplished by sorting ascending on the priority column in the view.
However the kanban view creates the 3 groups from left to right the same way,
So High | Medium | Low, when in fact i actually want the kanban view columns to be from left to right  : Low | Medium | High, while at the same time having the high priority cards at the top.

Thanks

Comments (2)
Nadezhda (DevExpress Support) 6 years ago

    Hello,
     
    Are you using your Priority column as a group column? If so, you can reorder groups if you set the column's SortOrder property to a required value.
    However, it is not clear what you mean by "having the high priority cards at the top". Do you need to reorder cards inside each group as well? If so, please clarify how you determine what cards should be on top when they have the equal Priority value.
    It would help if you provide a couple of screenshots to demonstrate the current and required behavior. Also, please clarify if your cards can be moved.
    I look forward to your response.

      Hey,

      So i have this setup in my designer for the priority column.
      The sort mode is set to Value, Ascending

      C#
      // // tcWorkflowPriority // this.tcWorkflowPriority.Caption = "Priority"; this.tcWorkflowPriority.FieldName = "Program.WorkflowPriorityId"; this.tcWorkflowPriority.FieldNameSortGroup = "Program.WorkflowPriorityId"; this.tcWorkflowPriority.Name = "tcWorkflowPriority"; this.tcWorkflowPriority.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.True; this.tcWorkflowPriority.SortMode = DevExpress.XtraGrid.ColumnSortMode.Value; this.tcWorkflowPriority.Visible = true; this.tcWorkflowPriority.VisibleIndex = 1;

      This means that all the data in my kanban view is being sorted by Priority : First High, then medium, then low.
      Which is what i want, as the cards are appearing in my view with all the High priority cards at the top of the view.
      See (1) in cards1.png attachment. The cards with higher priorities are appearing at the top of each of their current kanban groups.

      However at runtime i am able to change the groupcolumn to the priority column itself.

      C#
      tvProgramKanban.ColumnSet.GroupColumn = tcWorkflowPriority;

      This means i now get 3 vertical kanban groups for all my cards as well :

      However, since the sort on this column is Ascending, my 3 vertical groups are in the order of the enum : High | Medium | Low
      See (2) in card1.png attachment.
      I actually want the group order for that column to be reversed, Low | Medium | High
      So i think what im asking for is a way to sort the vertical kanban groups, independantly from the data in each column.

      Answers approved by DevExpress Support

      created 6 years ago

      Hello,

      You can set the SortOrder property to Descending to achieve this goal. Please test this approach and let me know if it works for you. If it does not help, modify the attached project to demonstrate your scenario.
      I look forward to your response.

        Comments (2)

          Hi,

          As per your solution, I changed the logic of my app to set the SortOrder to descending when that column is used as the grouping column.
          Thanks

          Nadezhda (DevExpress Support) 6 years ago

            I'm happy to hear that this approach is suitable for you. Please feel free to contact us in case of any difficulties.

            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.