DataGrid not showing data

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
CAsba
Posts: 452
Joined: Fri Sep 30, 2022 12:11 pm

DataGrid not showing data

Post by CAsba » Sat Jan 17, 2026 5:13 pm

Hi,
My dg has just 2 columns and 12 lines of data, all visible when clicking on the third icon from left in inspect mode. and with colours assigned under the sixth icon from the left. The problem is that when in operating mode none of the data is visible.
I can edit the data (that remains invisible) by using a set up of Ctrl-6 and Ctrl-7 to scroll up and down the lines of (invisible) data with ask command, but everything remains invisible.

Klaus
Posts: 14291
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: DataGrid not showing data

Post by Klaus » Sat Jan 17, 2026 6:34 pm

Hi CAsba,

very hard to tell from afar...
Textcolor is set correctly, so no white text on white background?
Textsize is correct?

You can send me the stack if oyu like an I will take a quick look, if you like: klaus AT major-k.de


Best

Klaus

stam
Posts: 3177
Joined: Sun Jun 04, 2006 9:39 pm

Re: DataGrid not showing data

Post by stam » Sat Jan 17, 2026 7:43 pm

CAsba wrote:
Sat Jan 17, 2026 5:13 pm
Hi,
My dg has just 2 columns and 12 lines of data, all visible when clicking on the third icon from left in inspect mode. and with colours assigned under the sixth icon from the left. The problem is that when in operating mode none of the data is visible.
I can edit the data (that remains invisible) by using a set up of Ctrl-6 and Ctrl-7 to scroll up and down the lines of (invisible) data with ask command, but everything remains invisible.
If data isn't displaying correctly, you should check the data structure.
The internal data should be a numerically keyed array - you can views this in the property inspector (go the 'custom' tab that shows custom properties and use the drop-down to view dgCache.
I should be in the format

Code: Select all

[1][column1]
[1][column2]
[2][column1]
[2][column2]
...
[n][column1]
[n][column2]

Klaus
Posts: 14291
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: DataGrid not showing data

Post by Klaus » Sun Jan 18, 2026 1:15 pm

Hi all,

it turned out that the datagrid in question had a VERY RARE case of data corruption.
There was a (numeric) KEY missing in the dgdata:
dgdata0.png
dgdata0.png (22.11 KiB) Viewed 186 times
I could let LC fix this by itself by simply adding a CR to the dgtext of the dg and immeditaley removed it again.
Obviously this made LC create a new "index" in the data and that fixed the whole thing.
dgdata1.png
dgdata1.png (24.42 KiB) Viewed 186 times
Best

Klaus

stam
Posts: 3177
Joined: Sun Jun 04, 2006 9:39 pm

Re: DataGrid not showing data

Post by stam » Sun Jan 18, 2026 1:19 pm

I would just be wary that this isn't a corruption but a bug in the OP's code.
If it is a bug, it should recur.

If this reproducibly happens again, then make sure you're code isn't assigning grade to an empty key or some such.

Klaus
Posts: 14291
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: DataGrid not showing data

Post by Klaus » Sun Jan 18, 2026 1:32 pm

I did not see any code that fills the datagrid with data, so I guess CAsba did this manually , maybe by copy/paste.
stam wrote:
Sun Jan 18, 2026 1:19 pm
... then make sure you're code ...
I am NOT code and never will! :-D

Post Reply