/// <summary>
/// 绘制Button事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void repositoryItemButtonEdit1_CustomDrawButton(object sender, DevExpress.XtraEditors.Controls.CustomDrawButtonEventArgs e)
{
//根据按钮的位置获取其选择的行
var hitIno = gridView1.CalcHitInfo(e.Bounds.Location);
if (hitIno.RowHandle < 0)
{
return;
}
DataRow row = gridView1.GetDataRow(hitIno.RowHandle);
if (e.Button.Caption == "曲线回放")
{
if (Convert.ToByte(row["state"]) == 3)
{
e.Button.Enabled = true;
}
else
{
e.Button.Enabled = false;
}
}
}