On Wednesday 08 August 2012 01:14:14 Patrick Goupell wrote:
> I have a stringgrid that I want to sort on column 1.
>
> I set the stringgrid.optionsgrid.og_sorted = true and the
> stringgrid.datacols.sortcol = 0 and stringgrid.datacols.sortdoldefault = 0.
>
> I use stringgrid.appendrow (msestringarray) to load the data into the
> stringgrid.
>
> The data does not sort.
>
appendrow() is used to add a single visible row to a grid which does not call 
tcustomgrid.checksort() automatically. It probably should, I must think 
about.
In order to fill a stringgrid with data please use:
"
<thegrid>.beginupdate;
try
 while <thereisdata> do begin
  <thegrid>.appenddatarow(<thedata>);
 end;
finally
 thegrid.endupdate();
end;
"

> Do I need to set something else?  Do something else to cause the
> stringgrid to sort?
>
Call checksort(), not recommended, please use the above code with 
appenddatarow() and beginupdate()/endupdate() instead.

Martin

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
mseide-msegui-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to