Setting Row Style

  • dkruggel 3 years, 7 months ago

    I can get the Row.Style to set properly in a VS2008 app. I am emulating existing code from VS2005 that currently works fine

    In the form there is a private CellStyle member:

    Private styLastRow As C1.Win.C1FlexGrid.CellStyle

    The form_load event populates this member:

    Me.styLastRow = Me.flxPropertyTable.Styles.Add("LastRow")
    Me.styLastRow.BackColor = System.Drawing.Color.LightSkyBlue

    An 'Insert' function applies this to the last row:

    Dim iCol As Integer
    iRow = System.Math.Max(iRow, 1)
    If (Me.flxPropertyTable.Rows.Count > 1) Then
    Me.flxPropertyTable.Rows(Me.flxPropertyTable.Rows.Count - 1).Style = Me.flxPropertyTable.Styles.Normal
    End If
    If (iRow < Me.flxPropertyTable.Rows.Count) Then
    iRow = Me.flxPropertyTable.Rows.Count - 1
    End If
    Me.flxPropertyTable.Rows(Me.flxPropertyTable.Rows.Count - 1).Style = Me.styLastRow
    Me.flxPropertyTable.Rows(Me.flxPropertyTable.Rows.Count - 1).Style = Me.flxPropertyTable.Styles("LastRow")
    Me.flxPropertyTable.Row = iRow
    Me.flxPropertyTable.Col = 0

    Aside from variable naming, it all looks identical between the code bases...

    Anyone have experience with this?

  • dkruggel 3 years, 7 months ago

    typo-- I CAN'T get the VS2008 code to set the row style.

  • 58p
    richas58p 3 years, 7 months ago


    I tried your code and it is working correctly at my end. You have declared a iCol object instead of iRow. I just changed it to 'Dim iRow As Integer' and it worked.

    Please refer to the attached sample implementing the code. Let me know if it works for you.


Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.