jauno
  • jauno
  • Member Topic Starter
2015-12-02T17:55:56Z
Hello everybody.
A new question about iGrid activex within vb6:
When I scroll a grid i have always only one part of all rows/cols visible in the client area of this grid.
How could I retrieve the first and the last visible column/row of a grid only in this client area?
As I know there is no SYS function yet for this (only for all cols/rows of the grid). Anyway how could I realize this?
lg Norbert (jauno)
Igor/10Tec
2015-12-03T11:44:37Z
iGrid.Sys(igSysCellsAreaStartRow) and iGrid.Sys(igSysCellsAreaEndRow) should return the index of the first and last visible row in the client area (viewport). For columns, these are iGrid.Sys(igSysCellsAreaStartCol) and iGrid.Sys(igSysCellsAreaEndCol). Do they return not the values you expect to retrieve?
jauno
  • jauno
  • Member Topic Starter
2015-12-03T18:12:25Z
Originally Posted by: Igor/10Tec 

iGrid.Sys(igSysCellsAreaStartRow) and iGrid.Sys(igSysCellsAreaEndRow) should return the index of the first and last visible row in the client area (viewport). For columns, these are iGrid.Sys(igSysCellsAreaStartCol) and iGrid.Sys(igSysCellsAreaEndCol). Do they return not the values you expect to retrieve?



Hello Igor!
For rows OK
OK when I scroll columns without frozen columns
Not OK when I scroll columns with frozen columns at the left
In this case the left visible col is always 1
This is what i see, but how can I retrieve the first visible column at the right of the frozen one?

Look at the code sent to you by email

lg Norbert
Igor/10Tec
2015-12-04T08:00:01Z
Thank you for this excellent question!!

You did not tell us that you are using frozen columns - sure, iGrid.Sys(igSysCellsAreaStartCol) will always return 1 in this case. To get the value you need, you should use the combination of the iGrid1.HScrollBar.Value and iGrid1.FrozenCols properties.

The fact is that if you have frozen columns, iGrid is automatically switched from pixel (smooth) scrolling mode to columns scrolling mode. Perhaps, you have already noticed that you can't have a scrollable column partially hidden by the last frozen column. And the horizontal scroll bar behaves accordingly in this case - its value always reports the number of columns hidden under the frozen band.

Having all this, the value you need is calculated like this:

iGrid1.FrozenCols + iGrid1.HScrollBar.Value + 1
jauno
  • jauno
  • Member Topic Starter
2015-12-04T17:04:07Z
Thank you Igor for this very usefull tip.