zoukankan      html  css  js  c++  java
  • 如何禁止在DBGRID末位自动添加一行记录

    http://www.tc5u.com/cpp/xg-1730729.htm

    用DBGridEh吧,只要设置属性alopAppendEh为false即可 


    最简单将DBGrid的option属性中goEditing设置为false,禁止DBGrid编辑 

    将datasource指向的table或query改readonly成true


    void __fastcall TForm1::Table1BeforeInsert(TDataSet *DataSet)
    {
      Abort();


    procedure TFormLOrder.DBGridLOrderKeyDown(Sender: TObject; var Key: Word;

    Shift: TShiftState);
    begin
    if (Key = VK_DOWN) or (Key = VK_TAB) then
    if DBGridLOrder.DataSource.DataSet.RecNo =
    DBGridLOrder.DataSource.DataSet.RecordCount then
    Key := 0;
    end;

    http://bbs.csdn.net/topics/20441300

    移动到最后一条记录时再按一下“下”就会追加一条记录,如果去掉这项功能

    procedure TForm1.DataSource1Change(Sender: TObject; Field: TField);
    begin
      if TDataSource(Sender).DataSet.Eof then TDataSource(Sender).DataSet.Cancel;
    end;

  • 相关阅读:
    mongodb笔记一
    mysql的备份和恢复
    explain的type列
    Debian下apache2设置并发
    nginx基本调优
    c语言struct
    Centos 安装nginx + php + mysql
    Debian下系统启动时执行脚本
    centos5.5服务器基本篇
    分治法
  • 原文地址:https://www.cnblogs.com/CodeGear/p/4918386.html
Copyright © 2011-2022 走看看