dgVScroll & dgHScroll of a datagrid

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
richh
Posts: 41
Joined: Tue Jan 25, 2011 8:48 pm

dgVScroll & dgHScroll of a datagrid

Post by richh » Wed Feb 02, 2011 3:52 pm

I am not sure if I encountered a bug or not.. but I am trying to get the scroll status for the vertical and horizontal of a datagrid.

after reading the online docs, I am using:

Code: Select all

put the dgVScroll of group "Datagrid 1" into VSValue
put the dgHScroll of group "Datagrid 1" into HSValue
regardless of if I set hScrollbar or vScrollbar to true, false, auto.... the values always returns 0
- Rich

LiveCode 4.6.4
Dell Latitude E6400 running Windows XP SP3 / Mac Pro, Macbook Pro & Mac Mini running OS X 10.6.4

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: dgVScroll & dgHScroll of a datagrid

Post by trevordevore » Thu Feb 03, 2011 2:33 pm

Can you confirm if the following experiment works?

1) Create new stack.

2) Drag data grid from tools palette onto stack.

3) Open object inspector for data grid and use Contents pane to enter enough lines so that the vertical scrollbar appears.

4) Drag the vertical scrollbar to the bottom.

5) In the message box execute the following code:

put the dgVScroll of group "DataGrid 1"

Does the message box report a value > 0?
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

richh
Posts: 41
Joined: Tue Jan 25, 2011 8:48 pm

Re: dgVScroll & dgHScroll of a datagrid

Post by richh » Fri Feb 04, 2011 3:51 pm

I tried your steps and the value does increase past 0.

Then I guess I am confused. I thought from the docs that dgVScroll and dgHScroll controlled weather or not the Vertical or Horizontal of a datagrid would show the scroll bar.

I went back to my code and starting playing around with hScrollbar and hScrollbar and found that they returned false.

by chance, do you know what properties hold the date for weather or not the horizontal / vertical is set to true, false or auto?

thank you in advance
- Rich

LiveCode 4.6.4
Dell Latitude E6400 running Windows XP SP3 / Mac Pro, Macbook Pro & Mac Mini running OS X 10.6.4

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: dgVScroll & dgHScroll of a datagrid

Post by trevordevore » Fri Feb 04, 2011 3:53 pm

You are looking for "show vscrollbar" and "show hscrollbar".

the dgProp["show vscrollbar"] of group "Datagrid"
the dgProp["show hscrollbar"] of group "Datagrid"

You can read about them on the API page of the docs:

http://lessons.runrev.com/spaces/lesson ... Properties
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder

richh
Posts: 41
Joined: Tue Jan 25, 2011 8:48 pm

Re: dgVScroll & dgHScroll of a datagrid

Post by richh » Sat Feb 05, 2011 12:22 am

thats it... thank you soooo much Trever...

I have been looking at the lession of Data Grid on the site, but I was looking at the Data Grid API section (one page over). :oops:
- Rich

LiveCode 4.6.4
Dell Latitude E6400 running Windows XP SP3 / Mac Pro, Macbook Pro & Mac Mini running OS X 10.6.4

Post Reply