在DBGrid中显示的最后一条记录(底部)之后插入

编程入门 行业动态 更新时间:2024-10-26 18:23:15
本文介绍了在DBGrid中显示的最后一条记录(底部)之后插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用ClientDataSet在最后一条记录之后插入的代码应该是什么?

What should be the code for inserting after the last record using the ClientDataSet?

我尝试了以下操作:

cdsSomething.Last; cdsSomething.Insert:

但是看起来它代替了最后一条记录.我确信必须有一个快速的代码.

But it appears it replaces the last record instead. I am sure there must be a quick code for this.

推荐答案

将记录追加到数据集末尾的方法(更不用说任何索引了)是 Append .您甚至无需先致电 Last .

The method to append a record to the end of the Dataset (let alone any index) is Append. You don't even need to call Last before.

cdsSomething.Append;

插入在所选记录之前插入一行,因此对于您的代码,新记录应成为倒数第二个记录.

Insert inserts a row before the selected record, so with your code, the new record should become the second to last record.

更多推荐

在DBGrid中显示的最后一条记录(底部)之后插入

本文发布于:2023-10-20 13:01:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1511040.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:DBGrid

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!