Caption := sgShopList.Rows[sgShopList.RowCount +].CommaText;

Caption := sgShopList.Rows[sgShopList.RowCount -1000].CommaText;

Rows[]的索引值,可以超过 RowCount,但是不能 小于0

Cells[]的索性值,读取时可以任意,包括-1 或者10000,不会报错。

  with TStringGrid.Create(Self )do
try
Parent := Self;
ShowMessage( Cells[-, ] );
finally
free
end;
function TStringGrid.GetCells(ACol, ARow: Integer): string;
var
ssl: TStringSparseList;
begin
ssl := TStringSparseList(TSparseList(FData)[ARow]);
if ssl = nil then Result := '' else Result := ssl[ACol];
end;

写入时,不能是 -1,但可以是 100000等

  with TStringGrid.Create(Self )do
try
Parent := Self;
Cells[, ] := '';
ShowMessage( Cells[, ] );
finally
free
end;

function TSparseList.Get(Index: Integer): Pointer;
begin
if Index < then TList.Error(SListIndexError, Index);
Result := FList[Index]
end;
    property Row: Longint read FCurrent.Y write SetRow;
procedure TCustomGrid.SetRow(Value: Longint);
begin
if Row <> Value then FocusCell(Col, Value, True);
end;
procedure TCustomGrid.FocusCell(ACol, ARow: Longint; MoveAnchor: Boolean);
begin
MoveCurrent(ACol, ARow, MoveAnchor, True);
UpdateEdit;
Click;
end;
procedure TCustomGrid.MoveCurrent(ACol, ARow: Longint; MoveAnchor,
Show: Boolean);
var
OldSel: TGridRect;
OldCurrent: TGridCoord;
begin
if (ACol < ) or (ARow < ) or (ACol >= ColCount) or (ARow >= RowCount) then
InvalidOp(SIndexOutOfRange);
if SelectCell(ACol, ARow) then
begin
OldSel := Selection;
OldCurrent := FCurrent;
FCurrent.X := ACol;
FCurrent.Y := ARow;
if not (goAlwaysShowEditor in Options) then HideEditor;
if MoveAnchor or not (goRangeSelect in Options) then
begin
FAnchor := FCurrent;
if goRowSelect in Options then FAnchor.X := ColCount - ;
end;
if goRowSelect in Options then FCurrent.X := FixedCols;
if Show then ClampInView(FCurrent);
SelectionMoved(OldSel);
with OldCurrent do InvalidateCell(X, Y);
with FCurrent do InvalidateCell(ACol, ARow);
end;
end;

TStringGrid的Rows索引值 和 Cells的 索引值, Row的赋值的更多相关文章

  1. MySQL_列值为null对索引的影响_实践

    一.首先看一个我在某公众号看到的一个关于数据库优化的举措 二.如果where子句中查询的列执行了 “is null” 或者 “is not null” 或者 “<=> null” 会不会使 ...

  2. 关于sortedlist 中值的添加,删除,索引测试.

    SortedList 类代表了一系列按照键来排序的键/值对,这些键值对可以通过键和索引来访问. 排序列表是数组和哈希表的组合.它包含一个可使用键或索引访问各项的列表.如果您使用索引访问各项,则它是一个 ...

  3. Oracle索引梳理系列(五)- Oracle索引种类之表簇索引(cluster index)

    版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...

  4. MySQL的索引类型和左前缀索引

    1.索引类型: 1.1B-tree索引: 注:名叫btree索引,大的方面看,都用的是平衡树,但具体的实现上,各引擎稍有不同,比如,严格的说,NDB引擎,使用的是T-tree,但是在MyISAM,In ...

  5. Oracle索引梳理系列(二)- Oracle索引种类及B树索引

    版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...

  6. mysql索引之四(索引使用注意规则:索引失效--存在索引但不使用索引)

    但是如果是同样的sql如果在之前能够使用到索引,那么现在使用不到索引,以下几种主要情况: 1. 随着表的增长,where条件出来的数据太多,大于15%,使得索引失效(会导致CBO计算走索引花费大于走全 ...

  7. sqlserver 索引的结构及其存储,索引内容

    sqlserver 索引的结构及其存储,sql server索引内容 文章转载,原文地址: http://www.cnblogs.com/panchunting/p/SQLServer_IndexSt ...

  8. mysql索引之三:索引使用注意规则(索引失效--存在索引但不使用索引)*

    使用索引时,有以下一些技巧和注意事项: (1)越小的数据类型通常更好:越小的数据类型通常在磁盘.内存和CPU缓存中都需要更少的空间,处理起来更快.(2)简单的数据类型更好:整型数据比起字符,处理开销更 ...

  9. SQL查询优化联合索引 与 单一列的索引

    目前WEB的普及太快,在实际的开发中,一旦遇到大数据量的时候就需要做到优化,让查询的更快,才能给客户更好的体验,也能够在程序上避免timeout. 部分转载自:https://www.cnblogs. ...

随机推荐

  1. SQL和access随机数

    Access: CLng(Rnd(种子数字)*1000000)   SQL Server ceiling(rand(abs(checksum(newid())))*1000000)    

  2. iis启动&nbsp;服务无法在此时接受控制信息。&nbsp;(异常来自&nbsp;HRESULT:0x80070425)

    问题描述:每隔一段时间应用程序池就会自动停止,报错:服务无法在此时接受控制信息.(异常来自 HRESULT:0x80070425)   iis启动 服务无法在此时接受控制信息. (异常来自HRESUL ...

  3. Openstack(十二)部署neuron(计算节点)

    在计算节点安装 12.1安装neuron(计算节点) # yum install openstack-neutron-linuxbridge ebtables ipset –y 12.2配置neutr ...

  4. spring requestmapping 拦截多个请求

    @RequestMapping(value = {"/picture_content/{id}","/attachment_content/{id}",&quo ...

  5. oracle 死锁查询及处理

    SELECT    bs.username "Blocking User", bs.username "DB User",          ws.userna ...

  6. MonkeyScript使用教程

    原文地址https://www.cnblogs.com/yizhou-xu/p/8072813.html 原文地址https://www.cnblogs.com/YatHo/p/7205162.htm ...

  7. ng-深度学习-课程笔记-6: 建立你的机器学习应用(Week1)

    1 训练/验证/测试集( Train/Dev/test sets ) 构建神经网络的时候有些参数需要选择,比如层数,单元数,学习率,激活函数.这些参数可以通过在验证集上的表现好坏来进行选择. 前几年机 ...

  8. 什么是ASCII码文本文件

    标准ASCII码方式(也称文本方式)存储的文件,更确切地说,英文.数字等字符存储的是ASCII码.文本文件中除了存储文件有效字符信息(包括能用ASCII码字符表示的回车.换行等信息)外,不能存储其他任 ...

  9. Java中使用OpenSSL生成的RSA公私钥进行数据加解密

    当前使用的是Linux系统,已经按装使用OpenSSL软件包, 一.使用OpenSSL来生成私钥和公钥 1.执行命令openssl version -a 验证机器上已经安装openssl 1 open ...

  10. bzoj1999 / P1099 树网的核

    P1099 树网的核 (bzoj数据加强) 前置知识:树的直径 (并不想贴我的智障写法虽然快1倍但内存占用极大甚至在bzoj上MLE) 正常写法之一:用常规方法找到树的直径,在直径上用尺取法找一遍,再 ...