Strange DataGrid behavior
Posted: Sun Dec 20, 2009 12:49 am
I am experiencing a very strange behavior while trying to begin working with dataGrids. I have a substack that starts out with one card on which I have placed and grouped onto a single background: 2 dataGrids, 1 regular field and three buttons. Two of the buttons are simple Previous and Next. The first DataGrid I filled by hand by pasting tab delimited data into the Contents field of the Inspector. It looks fine. The second DataGrid is intended to be a summary for the information in the first grid - sums etc.
The first thing I tried to do was to get the two grids to scroll together so that scrolling one would automatically scroll the other. It is the horizontal scrolling that I want to work together. Having done something similar with table fields before I tried (to no avail) I tried scripts like the one below:
After a little experimentation with things like hscroll of group "Sums" and other things I thought might work, I ended up loosing all the data that had previously been in my main Grid. I again put my data into the grid with an manual paste. I did not want to keep doing this by hand so I created a third button suggested in one of the DataGrid tutorials for automatically loading the data into a grid. It looks like this:
With this button now grouped with the rest I made a new card which had all the objects on it. The new card was created with no data (no surprise) and no headings (a bit of a surprise). With my trusty load button I decided to fill in the data in card 2. The data loaded but card 2 ended up having just data and no headings. I went back to card 1 and it had headings but no data. I was able to repeat this a number of times by fortunately quitting REV without saving changes and then coming back up with card one only.
Something seems to be going on but it makes no sense to me. Is it possibly related to the fact that the data I am trying to load into card 2 is exactly the same as the data I already have in card 1? I did discover among my attempts that the one of the heading fields had an extra space after it and consequently that column did not load but by fixing that, everything except headings loaded.
As you can see I have not gone very far into this and I will have way more to do.. I still want to control scrolling from one Grid and I want to get sums from the large grid to put into the Sums grid. I have been looking at the dataGrid tutorials as I go but am worried that these things are just too sensitive.
Any help you can give will be appreciated. Thanks,
Larry
The first thing I tried to do was to get the two grids to scroll together so that scrolling one would automatically scroll the other. It is the horizontal scrolling that I want to work together. Having done something similar with table fields before I tried (to no avail) I tried scripts like the one below:
Code: Select all
on scrollbarDrag
put the hscroll of me into tScroll
set the hscroll of field "Sums" to tscroll
end scrollbarDrag
Code: Select all
on mouseUp
answer file "Select the .TXT file to load:"
put it into theFile
put true into firstLineHeaders
set the dgText[firstLineHeaders] of group "PortfolioGrid" to URL("file:" & theFile)
end mouseUp
Something seems to be going on but it makes no sense to me. Is it possibly related to the fact that the data I am trying to load into card 2 is exactly the same as the data I already have in card 1? I did discover among my attempts that the one of the heading fields had an extra space after it and consequently that column did not load but by fixing that, everything except headings loaded.
As you can see I have not gone very far into this and I will have way more to do.. I still want to control scrolling from one Grid and I want to get sums from the large grid to put into the Sums grid. I have been looking at the dataGrid tutorials as I go but am worried that these things are just too sensitive.
Any help you can give will be appreciated. Thanks,
Larry