• devexpress GridControl 根据条件确定按钮是否有效


    /// <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;
    }
    }
    }

  • 相关阅读:
    数据库操作
    jquery 第一章
    算法很美 第一章
    python 学习第四天
    python学习第三天
    python学习第二天
    学习python的第一天
    C#-线程
    C#-流、存储
    C#-集合
  • 原文地址:https://www.cnblogs.com/xihong2014/p/15124194.html
Copyright © 2020-2023  润新知