Hello,
How to format property field to show datetime in format “yyyy-MM-dd”?
Ex
public class SomeProperty {
public DateTime DateOdBirth { get; set; }
// other properties
}
//..code…
propertyGrid1.SelectedObject = new SomeProperty();
Thanks,
Valeriano
As a follow on question, I use FormatDateTime in my vb desktop app as it responds to the local date format of the computer. How can I handle local date formatting with Wisej? This has proven to be a problem in previous apps since many of my users are from Europe and Australia and one of the key dates I display is an expiration date. It’s no problem internally in the app but it does create some unnecessary support requests.
Small correction.
It should rather be:
if (e.GridItem?.PropertyDescriptor?.Name == “LastUsed”)
{
e.CellStyle.Format = “dd.MM.yyyy”;
}
Best regards
Frank
Hi,
thanls, I try it.
Best regards,
Valeriano Simeone
Hi Valeriano,
usually this is done with TypeConverters (as in Winforms).
Wisej adds a PropertyValueFormatting event that you can use:
This shows 2 options, either format all DateTime properties in the PG or just a particular one (that is called “LastUsed” in this sample.
Hope that helps.
Best regards
Frank
Please login first to submit.