就是很普通的,我是用interbase+bde+query1的,我想让查询后的数据在grid里面能按1,2,3,4,5一样顺序列出序号,让人能够一目了然
能不能把具体程序列出来好吗?谢谢
能不能把具体程序列出来好吗?谢谢
解决方案 »
- 为什么捕获不到SQL SERVER 的异常??
- 怎么打印STRINGGRID中的内容??
- 问一个巨简单的问题。
- 急!关于在Delphi中用程序新建和删除一表格(给分100!再线等待!!!)
- @@@@@@@@@@@@@@@@@那位高手说说关于Yahoo Message那样嵌入IE中,成为一个菜单式样的工具板是如何实现的?(不是快速启动按钮)谢谢!@@@@
- d2009 datasnap json 传递三个OleVariant参数导致服务端退出
- 到底什么是嵌入式开发?
- 我打开一个文件如下语句,为何有错?
- 用delphi调用VC++写的dll的问题?
- 请教:关于MTS的初级问题(7万火急)。
- ado如何连接网络计算机的数据库呢?
- 土问:在post时出错了,adoquery1:dataset not in edit or insert mode.如何办?急啊!
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with DBGrid1.DataSource.DataSet do
begin
if DataCol = 0 then
DBGrid1.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, IntToStr(RecNo));
end;
var Text: string; DisplayText: Boolean);
begin
if Dataset.RecNo = -1 then
Text := '1'
else
Text := IntToStr(dateset.RecNo);
end;
先给dbgrid添上一列,不连任何数据,其Title.Caption属性设为'序号' ,再
procedure TForm.DBGridDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if (Column.Title.Caption = '序号') then
begin
(Sender as TDBGrid).Canvas.TextRect(Rect,Rect.Left,Rect.Top,IntToStr(ibquery.RecNo));
end;
end;