Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
Win Grid Row Style
posted

I have created a InitializeRow method below. I use it to style rows in a grid based on the strings contained within the selected row. This works fine but the style is not applied if the row is highlighted, ibstead the original isl style is applied. Basically what i want to know is can i apply a style  like "Me.gridTillItems.DisplayLayout.Override.ActiveRowAppearance = VoidStyle" but just to the selected row using the InitializeRowEventArgs object

Private Sub gridTillItems_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles gridTillItems.InitializeRow

If e.Row.Cells("ItemName").Value.ToString.ToUpper.Contains("VOID") Then

             Dim VoidStyle As Infragistics.Win.Appearance = New Infragistics.Win.Appearance

            With VoidStyle
                .ForeColor = Color.Black
                .FontData.SizeInPoints = 10
                .FontData.Strikeout = DefaultableBoolean.True
            End With
           
            e.Row.Appearance = VoidStyle

End If

End Sub

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    If I understood this correctly, it sounds like you want to assign an appearance to certain rows that takes effect only when they are activated. Since you mentioned the row being "highlighted", I am assuming that by selected you mean it exhibits the SelectedAppearance, and its Selected property returns true.

    The UltraGridRow class exposes an Appeareace (as you know), but this is a stateless appearance, and state-specific appearances override it when the row is in that state. To work around this for your purposes, I think you might be able to do something like handle the BeforeSelectChange or AfterSelectChange events, and set the row's Appearance property differently based on whatever criteria you are using.

Children