We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.


Thread ID:





2415 Jan 15,2003 09:20 PM Jan 16,2003 06:58 AM Windows Forms 1
Tags: GridControl
Harry Liem
Asked On January 15, 2003 09:20 PM

I am trying to create a workbook like in Excel. I have created a MDI Container form and it did not display the grid when I add new WorkbookForm child window. I have copied these codes from the gridpad sample project. WorkbookModel workbook = new WorkbookModel("Workbook"); GridModel sheet1 = new GridModel(); sheet1.RowCount = 100; sheet1.ColCount = 10; GridModel sheet2 = new GridModel(); sheet2.RowCount = 100; sheet2.ColCount = 10; workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 1", sheet1)); workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 2", sheet2)); WorkbookForm doc = new WorkbookForm(workbook); doc.ThemesEnabled = true; doc.MdiParent = this; doc.Show();

Administrator [Syncfusion]
Replied On January 16, 2003 06:58 AM

Try code like this. It is the Initialize call that makes things go through. Attached are both C# and VB sample projects showing a minimal MDI application with grid workbooks. workbook = new WorkbookModel("Workbook"); GridControl grid1 = new GridControl(); grid1.Initialize(); //set properties of grid1 grid1.RowCount = 20; grid1.ColCount = 5; grid1.TableStyle.BackColor = Color.LightBlue; grid1[1,1].Text = "Grid1"; GridControl grid2 = new GridControl(); grid2.Initialize(); //set properties of grid1 grid2.RowCount = 10; grid2.ColCount = 15; grid2.TableStyle.BackColor = Color.LightGray; grid2[1,1].Text = "Grid2"; workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 1", grid1.Model)); workbook.Worksheets.Add(new WorksheetModel(workbook, "Sheet 2", grid2.Model)); WorkbookForm doc = new WorkbookForm(workbook); doc.ThemesEnabled = true; doc.Text = workbook.Name + windowCount.ToString(); doc.MdiParent = this; doc.Show();


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.