• gridview上navigatr添加按钮事件,手动添加的行,取消自动添加行


    View Code
    private void grcPPintervalDetail_EmbeddedNavigator_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e)
    {
    if (e.Button.ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Append)
    {
    try
    {
    ApplyEdit();
    if (!string.IsNullOrEmpty(glucInvCName.EditValue.ToString()))
    {
    e.Handled
    = true;//取消默认新增事件
      grvPPintervalDetail.AddNewRow();
    int lineNum = grvPPintervalDetail.RowCount;
    grvPPintervalDetail.RefreshData();
    grvPPintervalDetail.MoveLast();
    string code = "";
    if ((1 < lineNum || lineNum == 1) && (lineNum < 9 || lineNum == 9))
    {
    code
    = "00" + lineNum;
    }
    if (10 <= lineNum)
    {
    code
    = "0" + lineNum;
    }
    grvPPintervalDetail.SetFocusedRowCellValue(grvPPintervalDetail.Columns[
    "PPIntervalCode"], (glucInvCName.EditValue.ToString() + code).ToString());
    }
    else
    {
    e.Handled
    = true;//取消默认新增事件
    MessageBox.Show("请先选择商品大类!");
    }
    }
    catch (Exception ex)
    {
    MessageBox.Show(ex.Message);
    }
    }
    }
  • 相关阅读:
    客户端加锁
    三次握手
    ForkJoinTask
    主从Reactor多线程模型
    Happen-before
    Enum
    Java 8
    Netty
    分布式一致性算法
    VisualStudio 2013 快捷键
  • 原文地址:https://www.cnblogs.com/JoshuaDreaming/p/1977809.html
Copyright © 2020-2023  润新知