OK!我已经解决了。原来是设置样式DataGridTableStyle里的问题,table的ReadOnly值不能在这写成true,否则它将一直是只读的,以后的修改无效。
private void TableStyleControl()
{
#region 设置样式
DataGridTableStyle tableStyle = new DataGridTableStyle(); tableStyle.MappingName = "TBLPRODUCT";
tableStyle.RowHeadersVisible = true;
// tableStyle.ReadOnly = true;
tableStyle.AllowSorting = true;
tableStyle.BackColor = System.Drawing.Color.FromArgb(255,255,230);
private void TableStyleControl()
{
#region 设置样式
DataGridTableStyle tableStyle = new DataGridTableStyle(); tableStyle.MappingName = "TBLPRODUCT";
tableStyle.RowHeadersVisible = true;
// tableStyle.ReadOnly = true;
tableStyle.AllowSorting = true;
tableStyle.BackColor = System.Drawing.Color.FromArgb(255,255,230);
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货