Hello
here is my code and i want to sort the aktiv and name columns in my rangegridcontrol sortbar. how to do this?
Code:
Private _SortBestandColumn As Integer
Private _SortBestandDirection As ListSortDirection
Private Shared ReadOnly HeaderBestand As String() = New String() {L("Aktiv"), L("Name")}
Private Sub InitGridBestand()
rgBestand.Clear()
_SortBestandColumn = 0
_SortBestandDirection = ListSortDirection.Ascending
_rngHeaderBestand = rgBestand.Add(0, 0, 0, HeaderBestand.Length - 1)
_rngHeaderBestand.Top = 0
_rngHeaderBestand.Left = 1
_rngHeaderBestand.RowHeight(0) = rgBestand.DefaultHeaderRowHeight
_rngHeaderBestand.HorizontalAlignment = GridHorizontalAlignment.Center
_rngHeaderBestand.Getter = Function(Row, Column) HeaderBestand(Column)
_rngHeaderBestand.SortHeader = True
_rngHeaderBestand.SortDirection = Function(Row, Column) If(Column = _SortBestandColumn, _SortBestandDirection, New ListSortDirection?)
_rngHeaderBestand.ColWidth(0) = 65
_rngHeaderBestand.ColWidth(1) = 160
Dim rngAktiv = rgBestand.Add(0, _BestandsEigenschaften.Count - 1, 0, 0)
rngAktiv.TopNeighbour = _rngHeaderBestand
rngAktiv.Left = 1
rngAktiv.HorizontalAlignment = GridHorizontalAlignment.Center
rngAktiv.VerticalAlignment = GridVerticalAlignment.Middle
rngAktiv.CheckBox = True
rngAktiv.Getter = Function(Row, Column) _Bestands.Contains(_BestandsEigenschaften(Row))
rngAktiv.Setter = Sub(Row, Column, Value)
Dim isChecked = ParseNullableBoolean(Value).GetValueOrDefault(False)
If isChecked Then
_Bestands.Add(_BestandsEigenschaften(Row))
Else
_Bestands.Remove(_BestandsEigenschaften(Row))
End If
End Sub
Dim rngName = rgBestand.Add(0, _BestandsEigenschaften.Count - 1, 0, 0)
rngName.TopNeighbour = _rngHeaderBestand
rngName.LeftNeighbour = rngAktiv
rngName.Getter = Function(Row, Column) _BestandsEigenschaften(Row)
rngName.Enabled = RangeGridControl.None
rgBestand.InitGrid()
rgBestand.FillGrid()
End Sub
Private Sub rgBestand_SortOrderChanged(sender As Object, e As SortOrderChangedEventArgs) Handles rgBestand.SortOrderChanged
If _SortBestandColumn <> e.Column Then
_SortBestandColumn = e.Column
_SortBestandDirection = ListSortDirection.Ascending
Else
If _SortBestandDirection = ListSortDirection.Ascending Then
_SortBestandDirection = ListSortDirection.Descending
Else
_SortBestandDirection = ListSortDirection.Ascending
End If
End If
UpdateBestandSort()
End Sub
i don't know how to complete UpdateBestandSort() method?
thank you