Need to format dates in dynamically built WPF DataGrid

后端 未结 8 601
眼角桃花
眼角桃花 2020-12-05 09:51

We are binding an unknown result set to a WPF DataGrid at run time. Some of our columns are going to contain DateTime values and we need to properly format these date time

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 10:31

    Hey you can set the locale culture info in the constructor of the WPF form as

    this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag);

    Or you can include the xml markup xml:lang="en-GB" in the window header markup

提交回复
热议问题