在DBGrid中显示的最后一条记录(底部)之后插入 [英] Inserting after the last record (bottom) shown in DBGrid

查看:67
本文介绍了在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中显示的最后一条记录(底部)之后插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆