Page 1 of 1

DataGrid Write-Over

Posted: Mon Sep 20, 2010 7:58 pm
by lohill
I have been doing a lot of work with datagrids and think that they are really useful. Occasionally I get into a situation where something I have done causes what looks like new data written over the top of old data. I have no idea what I am doing that causes this to happen because it does not appear to be on a regular basis. A refresh of the datagrid from the Inspector clears up the problem at the expense of losing part of the data. Are there any suggestions on what might be causing this and how I can avoid the problem in the future?

A co-question to this might be: Are there any limitations to using Dispatch "somedgCommand" to "DataGrid x" with ... as long as I fully identify the stack and card where DataGrid X resides?

Thanks for any suggestions,

Larry

Re: DataGrid Write-Over

Posted: Thu Sep 23, 2010 1:14 pm
by trevordevore
Prior to LiveCode 4.5 there was a bug that would reset script local variables when you right-clicked on a data grid (and possibly some other actions). This would effectively wipe out the data in the data grid as the data is stored in a script local variable which might lead to what you are seeing. LiveCode 4.5 fixes this though.
Are there any limitations to using Dispatch "somedgCommand" to "DataGrid x" with ... as long as I fully identify the stack and card where DataGrid X resides?
Assuming you don't have 2 data grids with the same name on the card then there should not be a problem.

Re: DataGrid Write-Over

Posted: Thu Sep 23, 2010 5:19 pm
by lohill
Thanks Trevor for always coming to my aid in dataGrid matters.

Larry

Re: DataGrid Write-Over

Posted: Thu Sep 23, 2010 6:23 pm
by trevordevore
You're welcome Larry.