Welcome to the Xceed Community | Help
Community Search  
More Search Options

WPF DataGrid & StyleSelector

Sort Posts: Previous Next
  •  01-27-2011, 11:00 PM Post no. 29687

    WPF DataGrid & StyleSelector

    In the WPF DataGrid, when the user does something that causes an error, we color the line with a red foreground using a StyleSelector:
     
    Public Class LineItemsGridRowStyleSelector
        Inherits StyleSelector

        Public Property LineItemExceptionStyle

        Public Overrides Function SelectStyle(ByVal item As Object, ByVal container As DependencyObject) As Style

            If TypeOf item Is OrderEntryLineItem Then
                If CType(item, OrderEntryLineItem).HasExceptions Then
                    Return LineItemExceptionStyle
                End If
            End If

            Return Nothing

        End Function

    End Class
     
    Our XAML then has this:
     
                     <DataGrid.RowStyleSelector>
                         <local:LineItemsGridRowStyleSelector LineItemExceptionStyle="{StaticResource LineItemRowExceptionStyle}" />
                    </DataGrid.RowStyleSelector> 
     
    Which references this:
     
    <Style x:Key="LineItemRowExceptionStyle" TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource {x:Type DataGridRow}}">
                     <Setter Property="Foreground" Value="Red"/>
               </Style> 
     
     
    Using the default WPF DataGrid theme from Microsoft, the line turns red.  However, it no longer turns red when using any of your themes.  Am I doing something wrong? 
  •  01-28-2011, 12:23 PM Post no. 29698 in reply to 29687

    Re: WPF DataGrid & StyleSelector

    Hi Matthew,

    We have a fix request currently pending to support implicit style keys for the MS DataGrid components, so that things such as this will work properly :

       BasedOn="{x:Type <DataGrid sub-component type>}"

    I have added you as a client interested in that fix. We will post an update in this forum thread when the fix becomes available. Thank you for your patience.

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  02-07-2011, 1:31 PM Post no. 29767 in reply to 29698

    Re: WPF DataGrid & StyleSelector

    Hi Diane,

    What is the timeline for this fix?  This is the only thing holding me back from purchasing your themes.  I'm releasing our WPF product to customers in early April, and I'd really love to have this fix by then.

    Thanks,
    Matt

  •  02-07-2011, 2:16 PM Post no. 29768 in reply to 29767

    Re: WPF DataGrid & StyleSelector

    Hi Matthew,

    According to the fix request, corrections have been made so that DataGridCell, DataGridColumnHeader, DataGridRow and DataGridRowHeader will now be implicitly styled when using the ResourceDictionary's implicit mode. This will be included in the next service release. I do not yet have a specific date, but my guess would be somewhere in early to mid March.

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  03-16-2011, 10:08 AM Post no. 30039 in reply to 29768

    Re: WPF DataGrid & StyleSelector

    Diane,

    This still isn't working in your latest update from a week ago.   This is a showstopper for me - I can't purchase your themes unless this is working.  My customers rely on the datagridrows having a red foreground (I'm porting a legacy VB6 app to WPF) if there is an exception.  

    I can tell you the issue.  The StyleSelector code (which is in my inital post above) is never called with your theme applied.  But with MS's default theme, it is called.

    Where do we go from here?

  •  03-16-2011, 10:37 AM Post no. 30041 in reply to 30039

    Re: WPF DataGrid & StyleSelector

    Hi Matthew,

    It is possible that the way you are using our component was not impacted by the changes we did. Could you send us a small test project that demonstrates the issue? That would help us to investigate further. Please send it to support@xceed.com and include a link to this forum thread as reference. Thank you.

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  03-16-2011, 11:41 AM Post no. 30043 in reply to 30041

    Re: WPF DataGrid & StyleSelector

    Diane,

    I just sent it to you!  Thanks. 

  •  05-10-2011, 10:58 PM Post no. 30324 in reply to 30043

    Re: WPF DataGrid &amp; StyleSelector

    Just a FYI.  This was fixed in your latest update, and we purchased your themes!  Thanks for the prompt service.  
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.