日期:2014-05-18  浏览次数:20923 次

gridcontrol控件新增方法没反应
为什么我button按钮里面写的
gridView1.AddNewRow();  
在gridcontrol里的gridview里面没反应呢?

------解决方案--------------------
例如:
C# code

/// <summary>
        /// 初始化新行的赋值
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
        {
            DataRowView drv = this.gridView1.GetRow(e.RowHandle) as DataRowView;
            if (drv != null)
            {
                drv["str_TypeID"] = this.m_strTypeID;
            }
        }