我对 Datagridview 单元格格式有疑问。我在下面添加我的示例代码,我尝试了许多关于此的百分比格式,但它不再工作了。问题出在哪里,能帮帮我吗?
private void button1_Click(object sender, EventArgs e)
{
DataTable tb = new DataTable();
DataRow row = tb.NewRow();
tb.Rows.Add(row);
tb.Columns.Add("Column1");
tb.Rows[0][0] = "45";
dataGridView1.DataSource = tb;
dataGridView1.Columns[0].DefaultCellStyle.Format = "#.000\\%";
}