怎么实现datagrid某一列下的新增行可编辑,其他行只能删除??谢谢:)

解决方案 »

  1.   

    可以用模版列,在里面帮控件(例如 TextBox),设Visible 属性为fasle
    当执行新增行的时候,在该行的控件属性设true
      

  2.   

    在DataSet设定一个特定的列即可实现
      

  3.   

    TO wcbgyjs,能说的清楚点吗?
      

  4.   

    private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
    {

    //MessageBox.Show(this.dataGrid1.CurrentRowIndex.ToString()+"    "+this.mySet.Tables[0].Rows.Count.ToString());
    if(this.dataGrid1.CurrentRowIndex==this.mySet.Tables[0].Rows.Count)
    {
    this.dataGridTextBoxColumn1.ReadOnly=false;
    }
    else
    {
    this.dataGridTextBoxColumn1.ReadOnly=true;
    }

    }