Click here to Skip to main content
15,881,873 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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
VB
_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
VB
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
        'Here I want to change the back color
        _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?
Posted

1 solution

Ask your question here[^], at Component Ones Support Forums.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900