Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Switch off Ensurevisibility

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

Switch off Ensurevisibility
Link Posted: 31-Oct-2006 03:22
Hello all,

I use three Flygrids on a form. One of them should give no reaction on EnsureVisibility...

Is it possible to switch of that feature?

regards Hans

thanks in advance.
Link Posted: 01-Nov-2006 01:12
Please describe more detaillly scenario of your problem,
Do you use EnsureVisible method?
You you want to freeze some of the FlyGrid's?
Link Posted: 01-Nov-2006 23:16
I don't use EnsureVisibility
My Form has 4 quadrants.

QI    , QII

QIII , QIV

QII is a Vertical Grid So the header is the left row.
The bottom row of the grid should has no space beetween row border line and the grid border. If I click now into a cell of the bottom row, that row jumps one line above. I think the reason is due to EnsureVisibility ensures the visibility of the row editing. This behavior is unrequested.

I know if I zoom the lines totally into the Grid this behavior does not happen. But then there is a ugly border at the bottom of the grid. This also unrequested.

To freeze the grid is probably not the requested behavior too, because it should be possible to add Columns.
Link Posted: 03-Nov-2006 00:13
You can use following trick to prevent TopRow changing in FlyGrid.Net:
[/c#]
public InitFlyGrid(FlyGrid flyGrid)
{
  //...
  //....
  flyGrid.TopRowChanging += new NineRays.Windows.Forms.FlyGrid.NotifyEventHandler(flyGrid_TopRowChanging);
  flyGrid.TopRowChange += new NineRays.Windows.Forms.FlyGrid.NotifyEventHandler(flyGrid_TopRowChange);
}

private int oldTopRow = -1;
private void flyGrid_TopRowChanging(object sender)
{
  FlyGridViewPort port = sender as FlyGridViewPort;
  oldTopRow = port.TopRow;
}

private void flyGrid_TopRowChange(object sender)
{
  if (oldTopRow == 0)
  {
    FlyGridViewPort port = sender as FlyGridViewPort;
    port.TopRow = oldTopRow;
    oldTopRow = -1;
  }
}