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. Centos 系统Java环境安装

    Java安装 安装SUN的JDK: 官网:http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260. ...

  2. python 使用qqwry.dat获取ip物理地址:速度快

    # -*- coding: utf-8 -*- import socket import struct class IPAddresss: def __init__(self, ipdbFile): ...

  3. java8工具类使用

    1:map的使用 computeIfPresent ,如果键已经存在,将键和值作为参数传到函数式中,计算返回新的值 import java.util.HashMap; import java.util ...

  4. flask nginx+uwsgi超时设置

    最近使用uwsgi+nginx经常程序执行一般就跳转到nginx报错页面,查看停止时程序日志还在写,nginx报错upstream timeout排查怀疑是超时的问题 设置nginx uwsgi_co ...

  5. Android 创建SQLite数据库(一)

    Android内置了轻量级的数据库SQLite,这里将自己理解作个记录,方便自己复习. 一.首先,创建SQLite数据库比较常见的方式是通过Android提供的SQLiteOpenHelper来实现, ...

  6. docker 删除所有的 docker ps -a 记录

    docker rm `docker ps -a -q` 删除的是镜像运行的实例,要删除镜像用docker rmi + 镜像名或者那串字符(image  id)

  7. ansible之template模块

    趁着最近在搞ansible,现在学习了一波template模块的用法: 1.使用template模块在jinja2中引用变量,先来目录结构树 [root@master ansible]# tree . ...

  8. tcpdump 的正确食用方法

    目录 tcpdump 使用笔记 重要报文头 字段表 ip header tcp header 基础使用 高级版本 指定ttl(通过ttl能够确定系统的类型) tcpdump 使用笔记 重要报文头 字段 ...

  9. Java语言的垃圾回收机制

    java语言从诞生开始,一个吸引人眼球的功能就是垃圾回收,想一想C++中时不时的内存泄漏,当时感觉写java代码直是一种享受呀.     和.NET的引用计数不同,java的垃圾回收机制采取的是有向图 ...

  10. markdown哈哈

    function box(){ 世界你好 }