scrollbar position on data grid

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
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

scrollbar position on data grid

Post by jalz » Thu Oct 01, 2015 11:08 pm

Hey Guys,

Whats the command to get and set the scrollbar position of the of a data grid?

I've tried the following, but not had any luck as it returns 0

put the scroll of group "dg_data" into tScrollPosition

put the vscroll of group "grp_scrollbar" into tScrollPosition

Thanks
Jalz

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: scrollbar position on data grid

Post by Klaus » Thu Oct 01, 2015 11:53 pm

Hi Jalz,

please get your copy of the datagrid docs here:
http://lessons.runrev.com/m/datagrid

The relevant parts:
...
dgHScroll
- get the dgHScroll
- set the dgHScroll to of group "DataGrid" pInteger
- Get/set the horizontal scroll of the data grid. This only applies to tables as forms do not scroll horizontally.
dgHScrollPercent
- get the dgHScrollPercent
- set the dgHScrollPercent of group "DataGrid" to pPercent
- Get/set the percentage of the horizontal scroll. A number between 0 and 1. This only applies to tables as forms do not scroll horizontally.
...
dgVScroll
- get the dgVScroll
- set the dgVScroll of group "DataGrid" to pInteger - Get/set the vertical scroll of the data grid.
dgVScrollPercent
- get the dgVScrollPercent
- set the dgVScrollPercent of group "DataGrid" to pPercent
- Get/set the percentage of the vertical scroll. A number between 0 and 1.
...

Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: scrollbar position on data grid

Post by jalz » Fri Oct 02, 2015 6:49 am

Thanks Klaus, forgot the datagrid had its own api...

Jalz

mrcoollion
Posts: 720
Joined: Thu Sep 11, 2014 1:49 pm
Location: The Netherlands

Re: scrollbar position on data grid

Post by mrcoollion » Mon Jan 02, 2017 4:33 pm

Even though it is obvious there is a small typo in the documentation which is:

set the dgHScroll to of group "DataGrid" pInteger

should be

set the dgHScroll of group "DataGrid" to pInteger

Regards,

Paul

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”