Major Datagrid Issues

zryip theSlug zryip.theslug at gmail.com
Tue Apr 17 14:22:45 EDT 2012


Hi Pete,

Sorry for the delay in the answer, I've just read your post.


Have you tried to send a ResetControl command to the datagrid, before
to change the dgNumberOfRecords property?

Example:

command PopulateMyDataGrid
   doMySQLStuff

   send "ResetControl" to grp "myDataGrid"
   set the dgNumberOfRecords of grp "myDataGrid" to tNumberOfRecords

end PopulateMyDataGrid

On Sat, Apr 14, 2012 at 3:57 AM, Peter Haworth <pete at lcsql.com> wrote:
> I am running into some pretty major issues using the datagrid's
> dgNUmberOfRecords/GetDataForLine functionality.
>
> First issue.
>
> I load data into the datagrid by setting the dgNumberOfRecords -
> GetDataForLine is called correctly, all looks fine.  Now I go through a
> filtering process and set the dgNUmberOfRecords again, let's say it ends up
> at 2.  GetDataForLine gets called twice and I see that I load the correct
> data into pDataA.  The datagrid now correctly shows two lines but they have
> the data from the first two lines of the original display, not the selected
> lines.  Bad news.
>
> Second Issue.
>
> This one seems to happen when the total number of rows in the datagrid is
> an exact multiple of the visible rows in the datagrid.  For example, let's
> say there are 50 records presented to the datagrid and it has 10 visible
> lines.  No problem with the initial display of the data.  Now I want to add
> a row of data to the end of the datagrid.  I set the dgNumberOfRecords to
> the new row count but the datagrid still shows the original last row at the
> end of the datagrid and I cannot scroll down any further.  I try scroliing
> up and down, no joy.  Bad News.
>
>
> Trevor or zryip, or anyone else - any ideas?


Best Regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.com




More information about the use-livecode mailing list