Datagrid Corruption

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Datagrid Corruption

Post by lohill » Sat Feb 02, 2019 11:32 pm

Way more often than I would like, I end up with a datagrid that gets corrupted when I load new data into it. The grid gives the appearance of having had data written over the top of existing data. Here is a screen shot of the looks like:
Screen Shot 2019-02-02 at 1.51.50 PM.png
When I am in the IDE I can usually bring up the Property Inspector for the datagrid and in the Data Grid tab take the choice "Refresh Data Grid". That usually clears it up. In a stand-alone application when that happens my data grid is ruined and only a new version of the application fixes it. What is the equivalent of "Refresh Data Grid" while in a stand-alone application? I could at least provide a menu option to clean up the mess if I knew how to program it.

As a rule when I load new data into an established datagrid I do the following:

Code: Select all

set the dgText of group "DataGrid 1" to empty
--do whatever is necessary to gather my data either as text (tText) or an array (tArray)
set the dgText of group "DataGrid 1" to tText
     or
set the dgData of group "DataGrid 1" to tArray 
I am confident that others have seen this problem, there must be a way to correct in a stand-alone.

Thanks,
Larry

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: Datagrid Corruption

Post by SparkOut » Sun Feb 03, 2019 8:53 am

How did you create the datagrid originally?
If you copied or cloned it there could be an issue with the internal references - I have seen glitches wirh copied datagrids in the past.
There was a scenario with a lesson, that advised for a datagrid to work in a standalone, you needed to include a "dummy" substack. I have heard this isn't necessary any more but I don't know. What version are you using?
What it looks most like to me, is a problem with having a duplicate, unwanted datagrid in the stack and "DataGrid 1" is named twice. I don't have any better thoughts than that at the moment.

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm
Location: San Diego, CA USA

Re: Datagrid Corruption

Post by lohill » Tue Feb 05, 2019 6:13 pm

I found 3 datagrid commands that may be helpful and am testing to see how they will work in a standalone. They are "refreshList", "resetList" and "resetControl". In my testing I have the user access them by way of a menu item. When I have observed the over writing condition I have tried each of them to see their effect. Here are my tentative conclusions:
"refreshList" has had no effect
"resetList" sometimes worked and sometimes not
"resetControl" worked each time I have tested it but the datagrid was left empty and needed to have its data installed again. Once new data was loaded the condition was gone. Inconvenient but better than nothing.

Larry

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”