sgray128 3/30/2016 3:38:13 PM

RadDock sorting

I have a task that inserts a tabbed document into a RadDock control. I needed a routine that would re-sort the tabs for me.


Sub SortDocumentWindows(oRadDock As RadDock)
        If oRadDock.DockWindows.Count <= 1 Then
            Exit Sub
        End If
        Dim intIndex As Int16 = 0
        Dim oDockWindows As System.Linq.IOrderedEnumerable(Of DockWindow) = oRadDock.DockWindows.OrderBy(Function(oDockWindow2) oDockWindow2.Text)
        For Each oDockWindow In oDockWindows
            oDockWindow.DockTabStrip.Controls.SetChildIndex(oDockWindow, intIndex)
            intIndex += 1
    Catch ex As Exception
        ErrorHandler.globalErrorHandler(ex, True)
    End Try
End Sub