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:
- for the prodcut code (this will be displayed in red if the product code is "P1";
- 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.