TStringGrid的Rows索引值 和 Cells的 索引值, Row的赋值
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的赋值的更多相关文章
- MySQL_列值为null对索引的影响_实践
一.首先看一个我在某公众号看到的一个关于数据库优化的举措 二.如果where子句中查询的列执行了 “is null” 或者 “is not null” 或者 “<=> null” 会不会使 ...
- 关于sortedlist 中值的添加,删除,索引测试.
SortedList 类代表了一系列按照键来排序的键/值对,这些键值对可以通过键和索引来访问. 排序列表是数组和哈希表的组合.它包含一个可使用键或索引访问各项的列表.如果您使用索引访问各项,则它是一个 ...
- Oracle索引梳理系列(五)- Oracle索引种类之表簇索引(cluster index)
版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...
- MySQL的索引类型和左前缀索引
1.索引类型: 1.1B-tree索引: 注:名叫btree索引,大的方面看,都用的是平衡树,但具体的实现上,各引擎稍有不同,比如,严格的说,NDB引擎,使用的是T-tree,但是在MyISAM,In ...
- Oracle索引梳理系列(二)- Oracle索引种类及B树索引
版权声明:本文发布于http://www.cnblogs.com/yumiko/,版权由Yumiko_sunny所有,欢迎转载.转载时,请在文章明显位置注明原文链接.若在未经作者同意的情况下,将本文内 ...
- mysql索引之四(索引使用注意规则:索引失效--存在索引但不使用索引)
但是如果是同样的sql如果在之前能够使用到索引,那么现在使用不到索引,以下几种主要情况: 1. 随着表的增长,where条件出来的数据太多,大于15%,使得索引失效(会导致CBO计算走索引花费大于走全 ...
- sqlserver 索引的结构及其存储,索引内容
sqlserver 索引的结构及其存储,sql server索引内容 文章转载,原文地址: http://www.cnblogs.com/panchunting/p/SQLServer_IndexSt ...
- mysql索引之三:索引使用注意规则(索引失效--存在索引但不使用索引)*
使用索引时,有以下一些技巧和注意事项: (1)越小的数据类型通常更好:越小的数据类型通常在磁盘.内存和CPU缓存中都需要更少的空间,处理起来更快.(2)简单的数据类型更好:整型数据比起字符,处理开销更 ...
- SQL查询优化联合索引 与 单一列的索引
目前WEB的普及太快,在实际的开发中,一旦遇到大数据量的时候就需要做到优化,让查询的更快,才能给客户更好的体验,也能够在程序上避免timeout. 部分转载自:https://www.cnblogs. ...
随机推荐
- pmd代码安全扫描工具
pmd是一款开源的代码扫描工具,这里对pmd做了一些修改,加了安全相关的插件.支持的代码文件类型:java.vue.js.xml 下载链接: https://files.cnblogs.com/fil ...
- Python多进程编程(转)
原文:http://www.cnblogs.com/kaituorensheng/p/4445418.html 阅读目录 1. Process 2. Lock 3. Semaphore 4. Even ...
- Shape of passed values is (3490, 21), indices imply (3469, 21)
背景 处理DataFrame数据时,抛了这个错误:Shape of passed values is (3490, 21), indices imply (3469, 21) 解决 数据出现重复,导致 ...
- 控制HttpContext为null
直接new一个 HttpContextBase _HttpContext= new HttpContextWrapper(System.Web.HttpContext.Current);
- 比特股-去中心化交易所, STEEM - 去中心化社区, EOS - 下一代智能合约
libsnark 是实现了 zkSNARK 模式的 C++ 库.zkSNARK 是一个证明/验证计算完整性的加密方法,也即零知识验证的算法, https://github.com/scipr-lab/ ...
- python selenium 安装与 chromedriver安装
安装 pip install selenium 安装完成之后运行脚本,如果没报错那ok.但是很不幸运,我报错啦.(本人使用ubuntu16.04,python2,or python3) 贴出我的报错: ...
- python webdriver 测试框架-数据驱动exce驱动,不用ddt的方式
data.xlsx: 脚本: #encoding=utf-8from selenium import webdriverimport timeimport datetimefrom openpyxl ...
- Broken pipe错误原因
这个异常是由于以下几个原因造成. 1.客户端再发起请求后没有等服务器端相应完,点击了stop按钮,导致服务器端接收到取消请求. 通常情况下是不会有这么无聊的用户,出现这种情况可能是由于用户提交了 ...
- postman 做接口测试
Postman 之前是作为Chrome 的一个插件,现在要下载应用才能使用. 以下是postman 的界面: 各个功能区的使用如下: 快捷区: 快捷区提供常用的操作入口,包括运行收藏夹的一组测试数据, ...
- 2017-2018-1 JaWorld 团队作业--冲刺5
2017-2018-1 JaWorld 团队作业--冲刺5(20162310) 团队项目之战斗机类分析博客 总结 我们本次团队项目设定为基于Android系统Java架构下的打飞机小游戏 游戏中所有模 ...