0
我从一个JSON源获取我的数据。然后,我将它转换为一个类类型,那么我将它设置为DataGridView中的数据源。的DataGridView cellFormat工作不格式化旧字符串新的字符串 - C#
此列的值是一样的东西:
12A12345
我希望能够对其进行格式化此类似:
12-A-123-45WR
private void dgvListDrivers_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 3)
{
int value;
if (e.Value != null)
{
e.CellStyle.Format = "##-#-###-##WR";
e.FormattingApplied = true;
}
}
}
但是这个代码不工作...