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

DataCell in edit mode on CardView grid doesn't automatically adjust transparent Infragistics XamMaskedEditor's Foreground

Sort Posts: Previous Next
  •  05-14-2010, 12:48 PM Post no. 26835

    DataCell in edit mode on CardView grid doesn't automatically adjust transparent Infragistics XamMaskedEditor's Foreground

    Attachment: CardView Issue.zip

    I am using two third-party controls (Infragistics XamTextEditor and XamMaskedEditor) in a DataGrid using the CardView view which changes the background colour of a DataCell depending on whether it is in edit mode or not.  To not obscure this background effect, I have set the Background of the XamTextEditor and XamMaskedEditor controls to Transparent.

    However, it seems that XamTextEditor automatically adjusts its Foreground according to the containing control's background colour, but XamMaskedEditor does not.  This is particularly prominent in when using 'Windows XP' theme/style with the colour scheme set to 'Default (blue)'.

    I tried putting the Infragistics controls on another control (a StackPanel) with its Background set to DarkBlue, but neither of the controls' Foreground changed to white; both remained black.  So, it appears that the DataGrid is "telling" the editor control to change its Foreground, but it is not doing so on the XamMaskedEditor for some reason.  Is this a failure on the part of the DataGrid or does the XamMaskedEditor not conform to some requirement?

    I've attached an example project demonstrating this.  Simply set your Display Settings to use 'Windows XP' theme, colour scheme 'Default (blue)' and then run the application.  Click 'New Item' and type into both cells.  The first one (which uses XamTextEditor) automatically provides a clear white Foreground against the dark blue background.  The second one (which uses XamMaskedEditor) shows the standard black Foreground which is difficult to see against the dark blue background.

    I've included the third-party controls required in the attached file.

    Please could this be investigated and let me know if there is a workaround and if a fix request needs to be raised on either the DataGrid or the third-party control (of course, I know the latter is not your remit)?

    Many thanks,

    Jason


    Associate, .NET Development
    Morgan Stanley, UK
  •  05-19-2010, 9:14 AM Post no. 26894 in reply to 26835

    Re: DataCell in edit mode on CardView grid doesn't automatically adjust transparent Infragistics XamMaskedEditor's Foreground

    Attachment: CardViewIssue.zip
    Hi Jason, 

    It seems that XamTextEditor does change its Foreground color but it doesn’t change it according to the containing control’s background color, it changes it to the containing control’s "Foreground" color.

    Find in the attached sample a few controls added to your sample, the xamTextEditor element inside the button named "xamTextButton" seems to take its foreground color from the control it lies within (The button) , which is not the case in all other controls.

    Find also a few additions in the DataGrid, the code is self explanatory.

    The editors for properties one, two, three and four are "a regular TextBox", "XamTextEditor", "XamMaskedEditor", and "xcdg:MaskedTextBox" respectively.  
    You will find the behavior for editors 1, 3, and 4 are similar. 
    Only xamTextEditor changes its foreground color.

    That foreground color is the same as that of the fieldnames when in EditMode (i,e, not the background color, same behavior in button “xamTextButton” where the xamTextEditor takes its foreground from the button and not its background).

    This behavior is present only in XamTextEditor, all the others :  “XamMaskedEditor”, “xcdg:MaskedTextBox” , even "XamNumericEditor" behave differently (they do not change their foreground color)
    This behavior I assume has nothing to do with the grid, as I can see the same result inside the grid and outside (when applied to regular .NET control) which is normal behavior.

    I hope this answers your question.

     


    Best Regards,

    Michel Dahdah
    Technical Support
    Xceed Software inc.
  •  05-20-2010, 10:17 AM Post no. 26921 in reply to 26894

    Re: DataCell in edit mode on CardView grid doesn't automatically adjust transparent Infragistics XamMaskedEditor's Foreground

    Thanks for your reply.

    Infragistics also answered on this matter and found it to be two separate bugs - one with each of the two editor controls involved in this issue.  One of them was actually causing behaviour I desired, though, which was simply a fluke due to the bug.  See their answer here: http://community.infragistics.com/forums/t/41497.aspx

    However, based on their answer I have found a solution, which is to base the Foreground of a transparent control (in this case, both xamTextEditor and xamMaskedEditor) on the Background of the containing ancestor.

    For my particular case, I used Mole to find out which ancestor was providing the dark background colour and it is Border.  I have put a Binding on the Foreground using a converter class to convert the colour.  This appears to resolve it.  I've attached the solution.

    Thanks for your assistance in this matter.

    Jason


    Associate, .NET Development
    Morgan Stanley, UK
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.