Bug Report B133293
Visible to All Users

Conditional Formatting - Doesn't work when DisplayName is used

created 16 years ago

I'm trying to create a report using an ITypedList collection. If I use System.ComponentModel.DisplayName attribute to assign a different name this is not correctly used when creating conditional formatting for inner collections.
I've these classes:
    public class Product
    {
        private string _productId;
        [System.ComponentModel.DisplayName("Codice Prodotto")]
        public string ProductId
        {
            get { return _productId; }
            set
            {
                _productId = value;
            }
        }
        private string _productDescription;
        [System.ComponentModel.DisplayName("Descrizione Prodotto")]
        public string ProductDescription
        {
            get { return _productDescription; }
            set
            {
                _productDescription = value;
            }
        }
        private List<ProductPrice> _prices = new List<ProductPrice>();
        [System.ComponentModel.DisplayName("Prezzi")]
        public List<ProductPrice> Prices
        {
            get { return _prices; }
            set
            {
                _prices = value;
            }
        }
    }
    public class ProductPrice
    {
        private decimal _Price;
        [System.ComponentModel.DisplayName("Prezzo")]
        public decimal Price
        {
             get     { return _Price; }
             set
             {
                  _Price = value;
             }
        }

private DateTime _validFromDate;
        [System.ComponentModel.DisplayName("Descrizione Prodotto")]
        public DateTime ValidFromDate
        {
             get     { return _validFromDate; }
             set
             {
                  _validFromDate = value;
             }
        }
    }
in the report I've created two conditionalFormatting rule:

  1. for the prodcut code (this will be displayed in red if the product code is "P1";
  2. for the property Price for the Prices child collection, this will be displayed in green if the price si grather than 12.
    And applyed the formatting rules accordingly.
    The first formatting rule is correctly displayed. See the report preview. The second is not applyed.
    Opening the REPX file you can see that the 2) formatting rule is not parsed to save the orginal field name and the Italian transaltion (from the FieldName Attribute) is used (look at "[Prezzo] >= 12" statement):
                //
                // formattingRuleForProductCode
                //
                this.formattingRuleForProductCode.Condition = "Trim([ProductId]) == 'P1'";
                //
                //
                //
                this.formattingRuleForProductCode.Formatting.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
                this.formattingRuleForProductCode.Name = "formattingRuleForProductCode";
                //
                // formattingRuleForPrice
                //
                this.formattingRuleForPrice.Condition = "[Prezzo] >= 12";
                this.formattingRuleForPrice.DataMember = "Prices";
                //
                //
                //
    If I manually changhe the REPX file (or via editor) writing [Price] >= 12, where "Price" is the orginal property name, everything works well.
    I'm already using the 8.3.4 fix as released in the http://www.devexpress.com/issue=B32669.
    Many thanks.
    Steps to Reproduce:
    Open the project start the editor and preview the report.
    Actual Results:
    The prices aren't formatted in green accordingly to the ConditionalFormattingRule.

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.