Bug Report T579144
Visible to All Users

GridListEditor - An appearance rule has no effect in the new item row until a value is entered into any cell

created 7 years ago (modified 7 years ago)

To reproduce:
- Open the MainDemo project.
- Add the Appearance("test", Enabled = false, TargetItems = "*", AppearanceItemType = "ViewItem", BackColor = "Yellow") rule to the DemoTask class.
- Run the project.
- Navigate to the DemoTask list view.
-> The rule has no effect in the NewItemRow (all cells are editable and have the default background color).
- Enter a value in any cell.
-> The rule is applied as expected.

Comments (1)
DevExpress Support Team 7 years ago

    We have investigated your scenario and found that the Conditional Appearance module requires an edited object to evaluate an appearance rule.
    In this scenario, an edited object is not created immediately when a cell editor is shown. It is created later, when a cell editor value is modified.
    We will see how to improve our code for this scenario, though I cannot promise any time frame. Nevertheless thank you for your feedback. I greatly appreciate your cooperation.
    In the meantime, I suggest that you handle the GridView.ShowingEditor event and set the e.Cancel property to true when the GridView.FocusedRowHandle property is GridControl.NewItemRowHandle.
    See also:
    Turning on editing capability on repository lookup editor for new row
    Hide columns in NewItemRow
    -  WinForms Grid: Prevent Editing in Specific Cells

    Answers approved by DevExpress Support

    created 7 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

    Additional information:

    Starting with v17.2.6, we have supported Appearance rules for the new item row in GridListEditor. The following behavior is now guaranteed by our tests:
     - An Appearance rule with empty criteria is applied to the new item row too, e.g., Enabled, FontColor, or BackColor (<AppearanceRule Id="LightBlueBackColorForAllRecords" BackColor="LightBlue" TargetItems="*" /> ):

    - An Appearance rule with Criteria = "This is null" is applied to the new item row until a value is entered into any cell (<AppearanceRule Id="SalmonBackColorForNewItemRowOnly" Criteria="This is null" BackColor="Salmon" TargetItems="*" /> ). Once you entered a value and closed the first editor, a new object is created internally and thus the rule's criterion no longer matches this record:


    The same behavior is observed in older XAF versions (e.g., v15.2) where this functionality was provided unofficially and without any tests.

    We look forward to hearing from ALL users who required Appearances rules operation for the new item row once you have had an opportunity to test these improvements.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.