Page 2 of 2
Re: Datagrid missing data
Posted: Sat Mar 06, 2021 7:55 pm
by dunbarx
Whew.
At least it was not 42.
When you recreated the array from scratch, did you use the original data? Why not create a new with an array of equal size, and with each element just, say, the character "X".
Craig
Re: Datagrid missing data
Posted: Sat Mar 06, 2021 9:40 pm
by istech
dunbarx wrote: Sat Mar 06, 2021 7:55 pm
Whew.
At least it was not 42.
When you recreated the array from scratch, did you use the original data? Why not create a new with an array of equal size, and with each element just, say, the character "X".
Craig
Why not 42?
This is the code I used.
repeat for each key tKey in OriginalArray
--if tKey is 16 then
--put "16" into sKey
add 1 to sKey
put trimWS(sKey) into tNewArray[sKey]["data1"]
put trimWS("NONE") into tNewArray[sKey]["data2"]
put trimWS("NONE") into tNewArray[sKey]["data3"]
put trimWS("NONE") into tNewArray[sKey]["data4"]
put trimWS("NONE") into tNewArray[sKey]["data5"]
put trimWS("NONE") into tNewArray[sKey]["data6"]
put trimWS("NONE") into tNewArray[sKey]["data7"]
put trimWS("NONE") into tNewArray[sKey]["data8"]
put trimWS("NONE") into tNewArray[sKey]["data9"]
put trimWS("NONE") into tNewArray[sKey]["data10"]
--end if
--exit repeat
end repeat
The trimWS function is not needed but for troubleshooting purposes added it in.
PS: I have amended the names of the original array/code as this is for a third party and sorry to say can't release the stack presently. However, the help put forward from everyone is well appreciated. Thanks for being a great community.
Re: Datagrid missing data
Posted: Sat Mar 06, 2021 10:11 pm
by istech
Some more progress on this. With the above code the datagrid is dropping the LAST key. See attached screen shot of the inspectors contents and datagrid.
Re: Datagrid missing data
Posted: Sat Mar 06, 2021 11:17 pm
by FourthWorld
What does TrimWS do?
Re: Datagrid missing data
Posted: Sun Mar 07, 2021 12:13 am
by dunbarx
Aha.
So it is not the 16th that matters, but the "last". This seems to me as well to be something in the data.
Why not 42?? Really??
Craig
Re: Datagrid missing data
Posted: Sun Mar 07, 2021 1:24 pm
by istech
FourthWorld wrote: Sat Mar 06, 2021 11:17 pm
What does TrimWS do?
function trimWS pText
-- Remove all leading and trailing whitespace characters.
-- I.E., space, tab, carriage return, line feed, form feed.
return replaceText(pText,"(^\s+)|(\s+$)",empty)
end trimWS
@ Craig Nope, What happened here? Key/line 42 had issue's in the past?
Re: Datagrid missing data
Posted: Sun Mar 07, 2021 1:45 pm
by stam
istech wrote: Sun Mar 07, 2021 1:24 pm
@ Craig Nope, What happened here? Key/line 42 had issue's in the past?
or probably a reference to
HHGTTG ?
Re: Datagrid missing data
Posted: Sun Mar 07, 2021 3:54 pm
by FourthWorld
Some problems can be solved easily with nothing more than a brief description of the issue. This does not appear to be one of those.
If you can post an example stack with data that exhibits the issue I'll bet we can resolve this quickly.
Re: Datagrid missing data
Posted: Sun Mar 07, 2021 6:11 pm
by dunbarx
Yes.
It has been a silly running mini-joke on this forum for a decade.
42 is the result of multiplying 6 by 9.
Craig
Re: Datagrid missing data
Posted: Sun Mar 07, 2021 7:31 pm
by stam
well, that was one of the questions proposed that gives the answer "42".
Another was many roads must a man walk down before he becomes a man

And so on...
Context:
In their travels, Arthur comes to learn that the Earth was actually a giant supercomputer, created by another supercomputer, Deep Thought. Deep Thought had been built by its creators to give the answer to the "Ultimate Question of Life, the Universe, and Everything", which, after eons of calculations, was given simply as "42". Deep Thought was then instructed to design the Earth supercomputer to determine what the Question actually is.
If you haven't read the trilogy of 5 books called
The hitchhiker's guide to the galaxy your life is incomplete

Re: Datagrid missing data
Posted: Sun Mar 07, 2021 8:10 pm
by istech
The good news.
I appear to have found a clue to the issue. Not sure if it is a bug or other. Maybe someone can answer. I had the property "fixed row height" selected for the datagrid. As soon as I deselect it the missing row data comes through. I'm sure this is not normal behaviour.
@ Craig - 42!.....Should of got that. Sorry a bit tired today. To be fair not read the books but seen the movie. Maybe time to give the books a go.

Re: Datagrid missing data
Posted: Mon Mar 08, 2021 6:14 pm
by jacque
It's normal behavior. A fixed height means that each row will be the same size. If there is more text than will fit in the height of the row, the extra will fall below the bottom border and you won't see it.
You can fix the problem by ensuring the row height is set to accommodate the largest amount of content you expect. If you do not use a fixed row height then the datagrid has to determine that value itself which can slow down its display.
Re: Datagrid missing data
Posted: Mon Mar 08, 2021 6:37 pm
by dunbarx
To be fair not read the books but seen the movie.
The movie was awful, the books, especially the first two, are wonderful.
Big difference.
Craig
Re: Datagrid missing data
Posted: Tue Mar 09, 2021 12:43 pm
by istech
jacque wrote: Mon Mar 08, 2021 6:14 pm
It's normal behavior. A fixed height means that each row will be the same size. If there is more text than will fit in the height of the row, the extra will fall below the bottom border and you won't see it.
You can fix the problem by ensuring the row height is set to accommodate the largest amount of content you expect. If you do not use a fixed row height then the datagrid has to determine that value itself which can slow down its display.
Thanks for this Jacque, I have reactivated the fixed row height and all appears to be working now. I have spent the last hour trying to recreate the circumstances that caused the issue as I'm uncomfortable giving over an app that could run into this issue along the line. Saying that I have been unable to get the same error/issue reoccur so far.
I'm leaning towards maybe there being a corrupt piece but of data that was entered and that caused the initial issue but this is inconclusive and would prefer finding a concrete reason. So will continue to investigate the core reason for the error/issue and add a little more code to check for corrupt keys/data.
Thanks for your help all and will update if I find a concrete reason on this as to help someone else.
@ Craig - Maybe when I get some free time I'll give the books a go. Maybe year 2042
