Home - Forums-.NET - FlyGrid.Net (Windows Forms) - How to set the number of a first visible column in flygrid

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

How to set the number of a first visible column in flygrid
Link Posted: 09-Nov-2006 21:57
Could you explain how it is possible to set the first visible column of a grid!
My request is:

Two grids, one upon the other!

Grid1

Grid2

Grid2 has a Horizontal scrollbar!
Grid1 should be scrolled synchron to Grid2 without having any scrollbar.

I tried two solution:
1) Set FlyGrid.Options &= ~GridOptions.PixelHorzScrollbar in both grids;
But FlyGrid.ActivePort.LeftCol is readonly! How could I set the column?
2)
use of
Grid1.ActivePort.SetHorzScrollOffset(...);
but this doesn't work there is happening nothing no matter if
Grid1.m_pFlyGrid.ActivePort.HScrollBarEnabled = true;
Grid1.m_pFlyGrid.ActivePort.VScrollBarEnabled = true;
is set or not
One further problem in this context is that the horizontal scrollbar in grid1 disapears after some short time/actions. I enabled the scrollbar in grid1 to see if it has anything to to with the problems.

thanks in advance.
Link Posted: 13-Nov-2006 01:18
Use FlyGridViewPort.SetHorzScrollOffset(int cOffset) method, where cOffset is visible column index what you want to set as LeftCol, when PixelHorzScrollbar is turned off.
But do not forget - if columns fit to the current client width(horizontal scroll bar is hidden), you can't use SetHorzScrollOffset to set LeftCol property. In this case LeftCol is always 0.