Hi Martin,
I'm lost with grids selections. How to make it work as simple
TListView with "report" mode and "rowselect"? First of all, by default
I don't see selection. So I checked this options:
gridAlbum.datacols.options := gridAlbum.datacols.options+
[co_fill,co_focusselect,co_mouseselect,co_rowselect];
Now I see what I selected. Going forward, real example from my app. I
have two grids. By default no one is selected (I mean row). Selecting
row in first grid, select first row in second grid (only if nothing
selected in second grid). Same rule for second grid, selecting
something select first row in first grid if nothing selected. Both
grids have only one column. Runtime issues:
1. If nothing selected, grid.row() return value below 0 (for example
-1073741823). Can I count on it? Should it be -1?
2. Tried with grid.getselectedrange.rowcount . If nothing selected
then it return 0 which is correct. So if it is 0 then I'm selecting
first row in second grid:
procedure TLibraryWidget.ArtistSelected(const sender: tobject);
begin
writeln('artist selected|',gridAlbum.getselectedrange.rowcount);
if gridAlbum.getselectedrange.rowcount=0 then
gridAlbum.selectcell(makegridcoord(0,0),csm_select);
end;
Problem is that, selectcell() indeed select row (I see it visually)
but at runtime getselectedrange.rowcount is still 0 after selectcell()
call so condition above is always TRUE. How to handle selections in
grids properly?
Regards
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk