Page 1 of 1
toggle data grid form view
Posted: Wed Feb 26, 2014 1:30 pm
by keram
Hi,
Is it possible to code the data grid form so that it will toggle between many-row view and 1 row view by clicking on the row?
keram
Re: toggle data grid form view
Posted: Wed Feb 26, 2014 1:58 pm
by Klaus
Hi keram,
yes
I see 2 possible solutions.
1. place another (exact duplicate) datagrid "datagrid2" on top of the datagrid with MANY rows "datagrid1".
Pseudocode in grp "datagrid1", the one with many rows:
Code: Select all
on mouseup
put the dgIndex of me into tIndex
## Prepare a new ARRAY with only ONE row in it to fill the other SINGLE row datagrid with this array
put the dgDataofInde[tIndex] of me into tArray[1]
lock screen
hide grp "datagrid1"
show grop "datagrid2"
set the dgdata of grp "datagrid2" to tArray
unlock screen
end mouseup
Then put this script into the SINGLE row datagrid:
Code: Select all
on mouseup
lock screen
hide grp "datagrid2"
show grop "datagrid1"
unlock screen
end mouseup
You get the picture
2. this would require much more scripting like temporarily storing the complete
dgdata of the datagrid, checking the current number of displayed row to determine
if we need to toggle from single to multi row etc...
In any case much more elaborate
Best
Klaus
Re: toggle data grid form view
Posted: Thu Feb 27, 2014 11:09 am
by keram
Hi Klaus,
Thanks for sharing these ideas.
I've asked this question to see if there are any other alternatives to the task I posted here:
http://ftp.runrev.com/forums/viewtopic.php?f=7&t=19339
However on your statement:
Klaus wrote:You get the picture
I can only answer: I got some kind of idea but not all is clear. But since it would involve 2 data grids instead of just 1 it may be even more complex and complicated than what I'm trying to accomplish with just 1 grid and 1 card.
I was hoping that there would be some way to change the row height according to the type of view I would chose. If there would be a way to set the row height in expanded line view to be as high as the data grid box itself...
Simon answered on my thread above so I'll try to accomplish that.
keram
Re: toggle data grid form view
Posted: Thu Feb 27, 2014 11:38 am
by SparkOut
I remember a webinar from 2009 where it was demonstrated how to have a datagrid view with rows of (in this case, employee data) and a "disclosure arrow" button. When you clicked on the button, the row view expanded to display more detailed information about the employee, including photos and personal summary. I will try and find a source for it. I think I probably have a copy downloaded but it will be a big file and I'm not sure about where to host it at the moment, so hopefully there is a link to a source already in existence.
Re: toggle data grid form view
Posted: Thu Feb 27, 2014 12:49 pm
by Klaus
Hi keram,
keram wrote:...But since it would involve 2 data grids instead of just 1 it may be even more complex and complicated than what I'm trying to accomplish with just 1 grid and 1 card.
I don't think that my couple of lines will be more complicated than managing
and scripting one datagrid to do what you want, you will see
Best
Klaus
Re: toggle data grid form view
Posted: Thu Feb 27, 2014 12:58 pm
by Simon
Sorry, the toggle in the other post I was referring to is in the button "Check".
Easy to solve.
Simon
Re: toggle data grid form view
Posted: Thu Feb 27, 2014 5:37 pm
by keram
Simon wrote:Easy to solve.
yea, I believe you.
keram