Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Scroll to bottom of FlyGrid automatically...

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

Scroll to bottom of FlyGrid automatically...
Link Posted: 30-Nov-2005 11:52
What I want to do is make FlyGrid scroll to the bottom (i.e. show last row) when I click a button.  Is this possible??

If so is it possible for you to give me an example of code in VB.Net.

Thanks

Simon
Link Posted: 01-Dec-2005 18:24
You can use following code construction to scroll to the bootom of FlyGrid:

flyGrid1.ActivePort.TopRow = (flyGrid1.ActivePort.RowCount - flyGrid1.ActivePort.VisibleRowsCount) + 1;
Link Posted: 01-Dec-2005 22:02
Thanks
Link Posted: 12-Dec-2005 11:46
I've just tried this but for some reason it does not scroll right to the bottom, instead it shows about half the bottom row.

Any ideas why this could be???

Thanks in advance

Simon
Link Posted: 12-Dec-2005 17:01
Use following code, with using FlyGrid.EnsureVisible method that has been included into FlyGrid.Net since v1.2.9:
[C#]
private void ShowNode(FlyGrid flyGrid, Nodebase node)
{  
  flyGrid.ActivePort.EnsureVisible(node);
}

private void ShowRow(FlyGrid flyGrid, int row)
{
  NodeBase rowNode = flyGrid.Rows.GetNodeFromRow(row);
  ShowNode(flyGrid, rowNode);
}

private void ShowLastNode(FlyGrid flyGrid)
{
  ShowRow(flyGrid, flyGrid.ActivePort.RowCount-1);
}

private void ShowFirstNode(FlyGrid flyGrid)
{
  ShowRow(flyGrid, 0);
}

Link Posted: 16-Jan-2007 01:22
[quote="NineRays"]You can use following code construction to scroll to the bootom of FlyGrid:

flyGrid1.ActivePort.TopRow = (flyGrid1.ActivePort.RowCount - flyGrid1.ActivePort.VisibleRowsCount) + 1;


Is there a way to do this for columns?  Such as:

flyGrid1.ActivePort.LeftCol = 4;

The LeftCol property is ReadOnly
Link Posted: 17-Jan-2007 00:16
use following code to set LeftCol (this code will work when GridOptions.PixelHorzScrollbar is turned off in flyGrid.Options)
[c#]
flyGrid.ActivePort.SetHorzScrollOffset(4);


when GridOptions.PixelHorzScrollbar is turned on, you should use pixel offset with this method.