Datagrid not showing it's data
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Datagrid not showing it's data
I have a table data grid that has 14 columns and 27,405 rows. The data is not visible and yet I can go into the IDE and under Datagrid-Contents see all the data. If I try Datagrid - Refresh Data the data still remains invisible. I can use 'set the dgText of group "DataGrid 1" to empty' and then reload the data. The data is still not visible even though the grid shows its vertical scroll bar and can be scrolled. I can use 'put the dgDataOFIndex[tIndex] of group "DataGrid 1" into tArray and see the data. I am pretty confident I could delete the data grid and create new one but there must surely be something easier that I can do. Any suggestions?
Thanks,
Larry
Thanks,
Larry
Re: Datagrid not showing it's data
Hi Larry,
quick guess, maybe you came to any display limitation?
Since in RAM everything seems to be working OK.
Try with fewer records to be sure.
Best
Klaus
quick guess, maybe you came to any display limitation?
Since in RAM everything seems to be working OK.
Try with fewer records to be sure.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid not showing it's data
Klaus,
I don't think this can be an issue, after all, we are not in the 1980's. Even with 27,000 lines and 14 columns, and even with 100 chars per DG field, that is still only around 40MB.
But the test might be interesting anyway. So Larry, make a copy, (I assume this one will also not show anything) get the DGText, delete half the lines, and restore the DGText back into the DG. But I bet the information does not just appear.
Unless it does. In that case, we need to tell Trevor.
Craig
I don't think this can be an issue, after all, we are not in the 1980's. Even with 27,000 lines and 14 columns, and even with 100 chars per DG field, that is still only around 40MB.
But the test might be interesting anyway. So Larry, make a copy, (I assume this one will also not show anything) get the DGText, delete half the lines, and restore the DGText back into the DG. But I bet the information does not just appear.
Unless it does. In that case, we need to tell Trevor.
Craig
Re: Datagrid not showing it's data
Hi Craig,
27000 * 14 = 378000 fields in the datagrid!
Best
Klaus
sure, but it is not the amount of data, the number of object MIGHT be the problem, so I just want to exclude this issue.
27000 * 14 = 378000 fields in the datagrid!
Best
Klaus
Re: Datagrid not showing it's data
Klaus and Craig,
I copied DataGrid 1 and pasted it on the same card and changed its name to DataGrid 2. It showed no visible data. In the Inspector, under Contents, I can see all the data. I deleted all but 5 lines of the data in DG2 and refreshed the data. Still nothing visible but the vertical scrollbar does not show. Lines 1 through 5 can be selected but not line six. I can get the dgDataOfIndex for any of the five lines and see the array data.
While doing all this I noticed in the Project Browser that the box that shows the number of lines in in the script for my button called "My Default Column Behavior" is RED. That button is associated with DG1. I have never seen that before so I'm not sure what to try next but there is something that LC does not like. That button is mostly used for formatting 'fill-in' data
Larry
I copied DataGrid 1 and pasted it on the same card and changed its name to DataGrid 2. It showed no visible data. In the Inspector, under Contents, I can see all the data. I deleted all but 5 lines of the data in DG2 and refreshed the data. Still nothing visible but the vertical scrollbar does not show. Lines 1 through 5 can be selected but not line six. I can get the dgDataOfIndex for any of the five lines and see the array data.
While doing all this I noticed in the Project Browser that the box that shows the number of lines in in the script for my button called "My Default Column Behavior" is RED. That button is associated with DG1. I have never seen that before so I'm not sure what to try next but there is something that LC does not like. That button is mostly used for formatting 'fill-in' data
Larry
Re: Datagrid not showing it's data
Unless things have changed in more recent versions of LiveCode, copy and paste is often the Vulcan Death Grip to a datagrid. It sounds like things have not really changed since the last versions I was using when I was last working with datagrids. I think it is because LiveCode loses track of the relationship between IDs of all the myriad individual objects that go together to make up the datagrid control.
Sometimes you can clone a datagrid successfully. I think sometimes you can copy and paste the Datagrid Template stack that is created when you add a datagrid. Usually it is far better to create from scratch and then set properties according to whatever template you have for the structure. I suspect this is your issue.
If you delete the datagrid and recreate it from scratch, I wonder if you will get the data visible again.
Sometimes you can clone a datagrid successfully. I think sometimes you can copy and paste the Datagrid Template stack that is created when you add a datagrid. Usually it is far better to create from scratch and then set properties according to whatever template you have for the structure. I suspect this is your issue.
If you delete the datagrid and recreate it from scratch, I wonder if you will get the data visible again.
Re: Datagrid not showing it's data
Spark Out,
My experience with datagrids has me agreeing to everything you have said. Over the years I have experienced this same thing and always just deleted the datagrid and started over. This is not a fun thing to have to do so I had hopes that someone else might have a simpler solution. Now that I have discovered that there is a probable error in my Default Column Behavior button maybe just replacing that button will solve it. I am sort of waiting to see what others say before trying that.
Larry
My experience with datagrids has me agreeing to everything you have said. Over the years I have experienced this same thing and always just deleted the datagrid and started over. This is not a fun thing to have to do so I had hopes that someone else might have a simpler solution. Now that I have discovered that there is a probable error in my Default Column Behavior button maybe just replacing that button will solve it. I am sort of waiting to see what others say before trying that.
Larry
-
- VIP Livecode Opensource Backer
- Posts: 9669
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Datagrid not showing it's data
Be sure to save the DGData somewhere before you do anything rash. When you say "not fun", I interpret that to mean rewriting those billions of fields that Klaus mentioned.
But LC says that the number of objects in a stack is "unlimited".
Craig
But LC says that the number of objects in a stack is "unlimited".
Craig
Re: Datagrid not showing it's data
Craig et al,
Found it and as usual it was operator error. I went to the code for the button "My Default Column Behavior" (the one that was red in the Project Browser). On the surface everything looked as I thought it should (no red dots). I added a blank line to one of my sections of code and then pressed 'Apply". I then got a red dot next to "on doubleMouseUp" indicating an error. A quick inspection and I discovered there was no "end mouseDoubleUp". I'm not sure how I lost it but it now is working just fine.
Larry
Found it and as usual it was operator error. I went to the code for the button "My Default Column Behavior" (the one that was red in the Project Browser). On the surface everything looked as I thought it should (no red dots). I added a blank line to one of my sections of code and then pressed 'Apply". I then got a red dot next to "on doubleMouseUp" indicating an error. A quick inspection and I discovered there was no "end mouseDoubleUp". I'm not sure how I lost it but it now is working just fine.
Larry