Janus GridEX: Loop through GridEX rows

Platform:Janus GridEX
Task:Loop through GridEX rows
Discussion:
You need to loop through the rows in a GridEX control.
Example:
            'get all the rows in the gridex and process them
            Dim SurveyWaypointRow As Janus.Windows.GridEX.GridEXRow
            If Me.SurveyWaypointsGridEX.RowCount > 0 Then
                For i = 0 To Me.SurveyWaypointsGridEX.RowCount - 1
                    SurveyWaypointRow = Me.SurveyWaypointsGridEX.GetRow(i)
                    Dim Lat As Decimal = SurveyWaypointRow.Cells("Latitude").Value
                    Dim Lon As Decimal = SurveyWaypointRow.Cells("Longitude").Value
                    Dim WaypointID As Decimal = SurveyWaypointRow.Cells("WaypointID").Value
                    DrawPoint(DrawingLayerHandle, Lat, Lon, WaypointID, Me.AxMapMain, 3, System.Convert.ToUInt32(RGB(255, 0, 0)))
                Next
            End If

            'get only the rows that are selected in the gridex and process them
            If Me.SurveyWaypointsGridEX.SelectedItems.Count > 0 Then
                Dim SelectedRows As Janus.Windows.GridEX.GridEXSelectedItemCollection = Me.SurveyWaypointsGridEX.SelectedItems
                For i = 0 To SelectedRows.Count - 1
                    SurveyWaypointRow = SelectedRows(i).GetRow
                    Dim Lat As Decimal = SurveyWaypointRow.Cells("Latitude").Value
                    Dim Lon As Decimal = SurveyWaypointRow.Cells("Longitude").Value
                    Dim WaypointID As Decimal = SurveyWaypointRow.Cells("WaypointID").Value
                    DrawPoint(DrawingLayerHandle, Lat, Lon, WaypointID, Me.AxMapMain, 6, System.Convert.ToUInt32(RGB(0, 255, 255)))
                Next
            End If
Back to Index