Version

GetSortOrder Method

An attached property that is used to determine the order in which the children will be displayed when the panel can arrange the items into multiple rows and the RowCount is the same as the MaxRows.
Syntax
'Declaration
 
Public Shared Function GetSortOrder( _
   ByVal d As DependencyObject _
) As Integer
public static int GetSortOrder( 
   DependencyObject d
)

Parameters

d
Remarks

If the sort order is not specified for all elements, the children will remain in their original order. If the sort order is specified for some elements but not all, all of the elements without a specified sort order will be displayed after the elements for which the value is specified and then sorted based on their original sort order.

Example
ToolHorizontalWrapPanel SetSortOrder, GetSortOrder methods

Dim toolHWrapPanel As New ToolHorizontalWrapPanel() 
toolHWrapPanel.MinRows = 1 
toolHWrapPanel.MaxRows = 2 

Dim button1 As New ButtonTool() 
button1.Caption = "Tool Button 1 ... " 

Dim button2 As New ButtonTool() 
button2.Caption = "Tool Button 2 ... " 

Dim button3 As New ButtonTool() 
button3.Caption = "Tool Button 3 ... " 

Dim button4 As New ButtonTool() 
button4.Caption = "Tool Button 4 ... " 

Dim button5 As New ButtonTool() 
button5.Caption = "Tool Button 5 ... " 

toolHWrapPanel.Children.Add(button1) 
toolHWrapPanel.Children.Add(button2) 
toolHWrapPanel.Children.Add(button3) 
toolHWrapPanel.Children.Add(button4) 
toolHWrapPanel.Children.Add(button5) 

ToolHorizontalWrapPanel.SetSortOrder(button1, 10) 
ToolHorizontalWrapPanel.SetSortOrder(button2, 20) 
ToolHorizontalWrapPanel.SetSortOrder(button3, 30) 
Dim sortOrder As Integer = ToolHorizontalWrapPanel.GetSortOrder(button3) 
ToolHorizontalWrapPanel.SetSortOrder(button4, sortOrder - 1) 
ToolHorizontalWrapPanel.SetSortOrder(button5, sortOrder + 1)
ToolHorizontalWrapPanel toolHWrapPanel = new ToolHorizontalWrapPanel();
toolHWrapPanel.MinRows = 1;
toolHWrapPanel.MaxRows = 2;

ButtonTool button1 = new ButtonTool();
button1.Caption = "Tool Button 1 ... ";

ButtonTool button2 = new ButtonTool();
button2.Caption = "Tool Button 2 ... ";

ButtonTool button3 = new ButtonTool();
button3.Caption = "Tool Button 3 ... ";

ButtonTool button4 = new ButtonTool();
button4.Caption = "Tool Button 4 ... ";

ButtonTool button5 = new ButtonTool();
button5.Caption = "Tool Button 5 ... ";

toolHWrapPanel.Children.Add(button1);
toolHWrapPanel.Children.Add(button2);
toolHWrapPanel.Children.Add(button3);
toolHWrapPanel.Children.Add(button4);
toolHWrapPanel.Children.Add(button5);

ToolHorizontalWrapPanel.SetSortOrder(button1, 10);
ToolHorizontalWrapPanel.SetSortOrder(button2, 20);
ToolHorizontalWrapPanel.SetSortOrder(button3, 30);
int sortOrder = ToolHorizontalWrapPanel.GetSortOrder(button3);
ToolHorizontalWrapPanel.SetSortOrder(button4, sortOrder-1);
ToolHorizontalWrapPanel.SetSortOrder(button5, sortOrder + 1);
<igRibbon:ToolHorizontalWrapPanel MaxRows="3" MinRows="1">
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="1" Id="Button1" Caption="Tool Button1 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="2" Id="Button2" Caption="Tool Button2 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="13" Id="Button3" Caption="Tool Button3 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="14" Id="Button4" Caption="Tool Button4 ... " />
    
<igRibbon:ButtonTool igRibbon:ToolHorizontalWrapPanel.SortOrder="5" Id="Button5" Caption="Tool Button5 ... " />
</igRibbon:ToolHorizontalWrapPanel>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also