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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





2415 Jan 16,2003 02:20 AM UTC Jan 16,2003 11:58 AM UTC WinForms 1
Tags: GridControl
Harry Liem
Asked On January 16, 2003 02:20 AM UTC

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 11:58 AM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon