' Added code for sorting the data Me.gdsDataSet.Tables("RouteStops").Select(Nothing, _ "intSequence ASC", DataViewRowState.CurrentRows) ' End code for sorting Me.lstRouteSegments.Columns.Add("Sequence", 80, HorizontalAlignment.Left) Me.lstRouteSegments.Columns.Add("Location", 300, HorizontalAlignment.Left) Me.lstRouteSegments.Columns.Add("ID", 80, HorizontalAlignment.Left) For liCount = 0 To Me.gdsDataSet.Tables("RouteStops").Rows.Count - 1 Me.gdrRow = Me.gdsDataSet.Tables("RouteStops").Rows.Item(liCount) lcListViewString = Me.gdrRow("strLocationDescription").ToString liListViewIndex = Me.gdrRow(lstrIDName).ToString liIntSequence = Me.gdrRow("intSequence").ToString ' Set the view to show details. Me.lstRouteSegments.View = View.Details ' Select the item and subitems when selection is made. Me.lstRouteSegments.FullRowSelect = True ' Display grid lines. Me.lstRouteSegments.GridLines = True Me.lstRouteSegments.AutoArrange = False ' Create the items. Dim item1 As New ListViewItem(liIntSequence, 0) item1.SubItems.Add(lcListViewString) item1.SubItems.Add(liListViewIndex) 'Add the items to the ListView. Me.lstRouteSegments.Items.AddRange(New ListViewItem() {item1}) Next