Hi all,
I'm currently modifying an application written by senior developer at my workplace. But, I got a problem when I try to change the appearance of the selected row in C1FlexGrid.
Here's my codes:
-code to initialize value
_fg.Rows.Count = _fg.Rows.Fixed
TreeSK.fg.SelectionMode = C1.Win.C1FlexGrid.SelectionModeEnum.Row
TreeSK.AddNode("Parent Node", "", "", 0)
For i As Integer = 0 To dtTrue.Rows.Count - 1
If dtTrue.Rows(i)(2).ToString().ToLower() = "penambahan" Then _
TreeSK.AddNode("", dtTrue.Rows(i)(0), dtTrue.Rows(i)(1), 1, EMap.TreeInfo.FGLevel.Child)
Next
TreeSK.AddNode("Parent Node 2", "", "", 0)
For i As Integer = 0 To dtTrue.Rows.Count - 1
If dtTrue.Rows(i)(2).ToString().ToLower() = "perubahan" Then _
TreeSK.AddNode("", dtTrue.Rows(i)(0), dtTrue.Rows(i)(1), 1, EMap.TreeInfo.FGLevel.Child)
Next
-code to handle selection
Private Sub _fg_AfterSelChange(ByVal sender As Object, ByVal e As C1.Win.C1FlexGrid.RangeEventArgs) Handles _fg.AfterSelChange
If m_FlagOperation = FlagOperation.StartEntry Then Exit Sub
Try
Dim _grid As C1.Win.C1FlexGrid.C1FlexGrid
Dim _containstring As String
Dim _typeObjek As String
_grid = CType(sender, C1.Win.C1FlexGrid.C1FlexGrid)
Dim level As Int16 = _fg.RowSel
_containstring = _grid.GetData(level, 0)
If Not String.IsNullOrEmpty(_containstring) Then
If _containstring.ToLower().Contains("TIANG TR".ToLower()) Then
BukaControl(1, 0, _grid.GetData(level, 1))
ElseIf _containstring.ToLower().Contains("STRAIN TR".ToLower()) Then
BukaControl(2, 0, _grid.GetData(level, 1))
End If
End If
_grid.Selection.Style.BackColor = Color.Azure
Catch ex As Exception
End Try
End Sub
The problem is, back Color of all child of the selected parent node changes when I select a child.
-ps:I just want the selection to be visible, no matter how it is done
Can anyone help me please?