其中update是DataGrid中update时触发的
changedata是为了调用方便写的

解决方案 »

  1.   

    楼主有没有试过不调用changedata,直接把changedata的代码写在update函数里?
      

  2.   

    1、模板列只有编辑时候能找到
    2、 /// <summary>
    /// To get the DataGrid control value
    /// </summary>
    /// <param name="Row">A zero based row number .</param>
    /// <param name="ColumnID">Control Id in DataGrid .</param>
    /// <returns>String</returns>
    public string GetItemString( int Row,string ColumnID )
    {
    if ( Row > this.Items.Count ) return "";
    DataGridItem dgItem = this.Items[Row]; // Try to find & deal with each control.
    for(int i=0;i<dgItem.Cells.Count;i++)
    {
    for(int j=0;j<dgItem.Cells[i].Controls.Count;j++)
    {
    Control ctrl = dgItem.Cells[i].Controls[j];
    if ( ctrl.ID == ColumnID && ctrl is TextBox ) return (( TextBox )ctrl).Text;
    if ( ctrl.ID == ColumnID && ctrl is Label ) return (( Label )ctrl).Text;
    }
    }
    return "";
    }