fmx中stringgrid如何动态加减列
delphi吧
全部回复
仅看楼主
level 8
ooooh_up 楼主
vcl中可通过defaultcolcount,fmx是怎么的,只有addobject,具体用法找不到
2015年04月28日 03点04分 1
level 8
ooooh_up 楼主
通过addobject虽然可以动态添加列,但运行后程序定住,无响应
2015年04月28日 03点04分 2
level 12
RowCount:=Rowcount+1;
2015年04月30日 09点04分 4
不是行,是列
2015年04月30日 13点04分
fmx列colcount是只读的
2015年04月30日 13点04分
@ooooh_up Col:=TStringColume.Create(StringGrid);Col.Parent:=StringGrid;
2015年05月03日 03点05分
多谢解答,动态减少列又如何实现?column[i].destroy无响应
2015年05月07日 04点05分
level 8
ooooh_up 楼主
2015年05月07日 13点05分 5
吧务
level 14
.disposeof
2015年05月07日 13点05分 6
谢谢
2015年05月08日 01点05分
level 8
ooooh_up 楼主
终于解决,之前一直调试不成功原因在于添加列时stringgrid.beginupdate与endupdate放在循环外。
删除列用disposeof是正式方法,之前我用realease。
另发现for i=1 to n begin end;循环结束后i=n+1。与vcl不同。
2015年05月08日 01点05分 7
level 8
ooooh_up 楼主
还有一个问题:一旦超出屏幕宽度,grid行显示不了表格线和背景色。
2015年05月08日 01点05分 8
2015年05月08日 01点05分
吧务
level 14
感谢 [广州]小枫(673214202); [南通]Lion(411920735)
[宁波]小卢(54927313) 2015-3-31 8:32:16
这个BUG 和XE7 的不一样,XE7 是2个BUG ,现在剩下一个了,后面的线有了,就是选中没着色,, 可以对着的修改下
关于stringgrid超出界面部分不显示行表格线和选择阴影问题解决
复制1份源代码C:\Program Files (x86)\Embarcadero\Studio\15.0\source\fmx\fmxgrid.pas到程序目录(并加入到你的工程)
解决行选择阴影
procedure TCustomGrid.UpdateSelection;
if Content.Width < ClientWidth then
R := RectF(P.X, P.Y, P.X + ClientWidth, P.Y + FRowHeight)
改成:R := RectF(P.X, P.Y, P.X + ClientWidth+10000, P.Y + FRowHeight)
else
R := RectF(P.X, P.Y, P.X + Content.Width, P.Y + FRowHeight);
改成:R := RectF(P.X, P.Y, P.X + Content.Width+10000, P.Y + FRowHeight);
2015年05月08日 05点05分 9
非常感谢,grid实在太多bug了,dephi从来都没解决好
2015年05月08日 06点05分
level 1
新的不成熟控件和vcl不能比
2016年05月04日 02点05分 10
1