就是在非绑定模式下,直接给单元格赋值,数字,或者数字转换的字符串
- private void 刷新ToolStripMenuItem_Click(object sender, EventArgs e)
- {
- c1FlexGrid1.Rows.Count = rowcount;
- DateTime dt = DateTime.Now;
- for (int i = 0; i < rowcount; i++)
- {
- for (int c = 0; c < c1FlexGrid1.Cols.Count; c++)
- {
- c1FlexGrid1[i, c] =( i + c).ToString();
- }
- }
- toolStripTextBox1.Text = (DateTime.Now - dt).TotalMilliseconds.ToString();
- }
复制代码 |