The problem shown in [http://www.kingvest.de/qb.wmv] is solved.
About the [http://www.kingvest.de/bugs/sizing2/sizing2.html] - I'll try to describe:
The sample that demonstrates ways of node additions described below you can download here
There are three ways to add node:
[c#] 1.More Optimal
private void button1_Click(object sender, System.EventArgs e)
{
object[] data = new object[]{
rnd.Next(1000) > rnd.Next(1000),//size
string.Format("(KLAC) KCQ; DK{0:F} Call", rnd.Next(1000)/6),//strike
string.Empty,//lots
decimal.Round(decimal.Remainder(1, (decimal)rnd.NextDouble()), 2),//bid
decimal.Round(decimal.Remainder(1, (decimal)rnd.NextDouble()), 2),//ask
};
this.performanceGrid.Rows.Items.Add(new Node(data));
}
[c#] 2. Less Optimal
private void button3_Click(object sender, System.EventArgs e)
{
Node newNode = new Node(new object[performanceGrid.Columns.VisibleColumns.Length]);
this.performanceGrid.Rows.Items.Add(newNode);
for(int i=0; i < performanceGrid.Columns.VisibleColumns.Length; i++)
{
object cellValue = null;
switch(i)
{
case 0:
cellValue = rnd.Next(1000) > rnd.Next(1000);//size
break;
case 1:
cellValue = string.Format("(KLAC) KCQ; DK{0:F} Call", rnd.Next(1000)/6);//strike
break;
case 2:
cellValue = string.Empty;//lots
break;
case 3:
case 4:
cellValue = decimal.Round(decimal.Remainder(1, (decimal)rnd.NextDouble()), 2);//bid/ask
break;
}
//in this case column automatically recalculates width
performanceGrid.Columns.VisibleColumns[i].SetValue(newNode, cellValue);
}
}
[c#] 3. Minimally Optimal for autocalculations - need to use BeginInit/EndInit to force calculations
private void button3_Click(object sender, System.EventArgs e)
{
Node newNode = new Node(new object[performanceGrid.Columns.VisibleColumns.Length]);
this.performanceGrid.Rows.Items.Add(newNode);
for(int i=0; i < performanceGrid.Columns.VisibleColumns.Length; i++)
{
object cellValue = null;
switch(i)
{
case 0:
cellValue = rnd.Next(1000) > rnd.Next(1000);//size
break;
case 1:
cellValue = string.Format("(KLAC) KCQ; DK{0:F} Call", rnd.Next(1000)/6);//strike
break;
case 2:
cellValue = string.Empty;//lots
break;
case 3:
case 4:
cellValue = decimal.Round(decimal.Remainder(1, (decimal)rnd.NextDouble()), 2);//bid/ask
break;
}
newNode.SetCellValue(this.performanceGrid.Columns.VisibleColumns[i], cellValue);
}
}
As you can see - you can use more optimal ways to add node without BeginInit/EndInit usage or use BeginInit/EndInit to force recalculations.
NB: The 2. Example related to the [http://www.kingvest.de/qb.wmv] and will work correctly with nearest update.