Dear sir,
void pickcurrentquestion()
{
List<string[]> itemIDs = new List<string[]>();
for (int i = 0; i < numberofQuestions; i++)
{
if (allquestions[i, 0] == currentquestion.ToString())
{
itemIDs.Add(new string[4] { allquestions[i, 0], allquestions[i, 1], allquestions[i, 2], allquestions[i, 3] });
}
}
if (itemIDs.Count < 1)
{
MessageBox.Show("You have finished all the Questions :-)");
return;
}
int rowheight = 20;
Array.Resize(ref match1, itemIDs.Count);
TableNode tbResources = diagram1.Factory.CreateTableNode(10, 10, 100, rowheight * itemIDs.Count);
tbResources.DeleteColumn(0);
tbResources.RowHeight = rowheight;
tbResources.RedimTable(1, itemIDs.Count);
tbResources.Caption = itemIDs[0][1].ToString();
tbResources.Font = new Font(FontFamily.GenericSansSerif, 9.0F, FontStyle.Italic, GraphicsUnit.Pixel);
tbResources.Pen = new MindFusion.Drawing.Pen(Color.FromArgb(192, 192, 192));
tbResources.CaptionHeight = rowheight;
tbResources.CaptionBrush = new MindFusion.Drawing.SolidBrush(Color.White);
tbResources.CaptionBackBrush = new MindFusion.Drawing.SolidBrush(Color.FromArgb(247, 150, 70));
TableNode tbResources1 = diagram1.Factory.CreateTableNode(210, 10, 100, rowheight * itemIDs.Count);
tbResources1.RowHeight = rowheight;
tbResources1.RedimTable(1, itemIDs.Count);
tbResources1.Caption = itemIDs[0][2].ToString();
tbResources1.Font = new Font(FontFamily.GenericSansSerif, 9.0F, FontStyle.Italic, GraphicsUnit.Pixel);
tbResources1.Pen = new MindFusion.Drawing.Pen(Color.FromArgb(192, 192, 192));
tbResources1.CaptionHeight = rowheight;
tbResources1.CaptionBrush = new MindFusion.Drawing.SolidBrush(Color.White);
tbResources1.CaptionBackBrush = new MindFusion.Drawing.SolidBrush(Color.FromArgb(247, 150, 70));
for (int i=1;i<itemIDs.Count;i++)
{
tbResources[0, i-1].Text = itemIDs[i][1].ToString();
tbResources1[0, i-1].Text = itemIDs[i][2].ToString();
match1[i-1] = Convert.ToInt32(itemIDs[i][3])-1;
}
diagram1.Nodes.Add(tbResources);
diagram1.Nodes.Add(tbResources1);
}
this is the function i am using. itemIDs.Count is created at the each time. here only i am creating the table node other than this i not creating any nodes.