Hi !
When the listview automatically create colums with GenerateColumns in Utilities/Generator.cs, and when we have property descriptors spécified in our class, this function is called (line 295) to make each column :
public virtual OLVColumn MakeColumnFromPropertyDescriptor(PropertyDescriptor pd) {
OLVColumnAttribute attr = pd.Attributes[typeof(OLVColumnAttribute)] as OLVColumnAttribute;
return MakeColumn(pd.Name, DisplayNameToColumnTitle(pd.DisplayName), !pd.IsReadOnly, pd.PropertyType, attr);
}
I have the following bug with this :
--> my proprety descriptor "DisplayName" is : "Epaisseur (µm)" in my class.
But when the function DisplayNameToColumnTitle is called to create column, it change the Name with "Epaisseur (Mm)", same exemple with "Grammage (g/m²)" become "Grammage (G/M²)".
I think it's because of the regex in the function DisplayNameToColumnTitle.
When we create a column from propertydescrtiptor, I think you can remove the call of the function DisplayNameToColumnTitle because we already have set the good text to appear in the column title.
In general, the
DisplayName
of a property is simply the name of the property, e.g. SomethingLikeThisProperty. To have those pretty names, you must have put aDisplayName()
attribute on the property itself.To have those exact string as your column title, put an
OLVColumn()
attribute on your property instead, and set theTitle
to be the pretty string you want.Closed, since this is not a bug.