Davide Icardi - 2007-10-29

Logged In: YES
user_id=1515232
Originator: YES

from radioman:
"""""""""
.i have few changes and it work allmost perfect.

/// <summary>
/// Refresh the linked controls bounds
/// </summary>
public virtual void ArrangeLinkedControls()
{
SuspendLayout();
foreach (LinkedControlValue linked in m_LinkedControls)
{
if (linked.Position.IsEmpty())
continue;

Control control = linked.Control;
Cells.ICellVirtual cell = GetCell(linked.Position);

// REMEMBER CONTROL POSITION
control.Tag = linked.Position;

Rectangle rect = PositionToRectangle(linked.Position);

if (cell != null && linked.UseCellBorder)
rect = Rectangle.Round(cell.View.Border.GetContentRectangle(rect));

control.Bounds = rect;
}
ResumeLayout(false);
}

SourceGrid.LinkedControlValue control = new SourceGrid.LinkedControlValue(gfact, new SourceGrid.Position(rf, 2));
GridMain.LinkedControls.Add(control);
GridMain.ArrangeLinkedControls();

control.Control.LocationChanged += new EventHandler(Control_LocationChanged);

void Control_LocationChanged(object sender, EventArgs e)
{
Control c = (Control)sender;
SourceGrid.Position p = (SourceGrid.Position)c.Tag;
SourceGrid.Position p2 = new SourceGrid.Position(p.Row - 1, p.Column);

if (GridMain.IsCellVisible(p2, true) == false)
{
c.Visible = false;
}
else if (!c.Visible)
{
c.Visible = true;
}
}

..the last 'problem' is when i use mouse middle scroll then its scrolls more than one row, and i see a litle flicker ;/, so i'll post when i corect this too..
"""""""""

see also
http://www.devage.com/Forum/ViewTopic.aspx?id=3c852fa7cb564e51b050f484a0a04af8