日期:2014-05-18 浏览次数:20670 次
dataGridView1.Columns[9].DefaultCellStyle.Format = "#.00%";
private void button1_Click(object sender, EventArgs e) { DataTable table = new DataTable(); table.TableName = "aa"; table.Columns.Add("test", typeof(float)); DataRow row = table.NewRow(); row[0] = 0.82; table.Rows.Add(row); dataGridView1.DefaultCellStyle.Format = "#.00%"; dataGridView1.DataSource = table; }
------解决方案--------------------
只有FLOAT型才可以