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.
Syncfusion Feedback

Excel like Workbook -

Thread ID:

Created:

Updated:

Platform:

Replies:

31658 Jul 12,2005 06:34 AM Jul 13,2005 03:56 AM Windows Forms 3
loading
Tags: GridControl
Adam K.
Asked On July 12, 2005 06:34 AM

I see the workbook sample that gives youa a multiple spreadsheet feel. A few questions: 1. If I am going to have 30+ sheets is it better to use the workbook feature (as in the sample) or have a tab control where i only have 1 grid control that gets moved around to each tab when i click on it (are there any samples like this). is this more efficient because i only have one control. 2. How can i programatically add "sheets" to the workbook. Assume i have a button and a textbox on top and when i click on the button i get a new tab where the sheet name is the text in the textbox. thanks, ak

Administrator [Syncfusion]
Replied On July 12, 2005 01:31 PM

1) What is going to hold your data? If the grid is to hold the data (using a non-virtual GridControl), then using multiple grid is as easy as anything. But if you are going to use a GridDataBoundGrid and have the data stored in multiple Datatables, then you could probably get away with using a single grid. When you changed tabs, you would have to set the grid.DataSource property to the proper DataTable. You would also have to have some formatting code that would do page dependent formatting if you have any. 2) Here is a button handler that will add a tabpage.
private void button1_Click(object sender, System.EventArgs e)
{
	Syncfusion.Windows.Forms.TabBarPage page = 
				new Syncfusion.Windows.Forms.TabBarPage();
	page.Text = this.textBox1.Text;
	this.tabBarSplitterControl1.TabBarPages.Add(page);

	//activate it it desired
	this.tabBarSplitterControl1.ActivePage = page;
}

Administrator [Syncfusion]
Replied On July 13, 2005 12:28 AM

Answer to Question 1: I am using a virtual grid where most of my grid is user input. I am using QueryCellinfo and SaveCellinfo to get data back and forth from the grid and my data structures. Please let me know your recommendation in this case. thanks, ak >1) What is going to hold your data? If the grid is to hold the data (using a non-virtual GridControl), then using multiple grid is as easy as anything. > >But if you are going to use a GridDataBoundGrid and have the data stored in multiple Datatables, then you could probably get away with using a single grid. When you changed tabs, you would have to set the grid.DataSource property to the proper DataTable. You would also have to have some formatting code that would do page dependent formatting if you have any. > >2) Here is a button handler that will add a tabpage. > >
>private void button1_Click(object sender, System.EventArgs e)
>{
>	Syncfusion.Windows.Forms.TabBarPage page = 
>				new Syncfusion.Windows.Forms.TabBarPage();
>	page.Text = this.textBox1.Text;
>	this.tabBarSplitterControl1.TabBarPages.Add(page);
>
>	//activate it it desired
>	this.tabBarSplitterControl1.ActivePage = page;
>}
>

Administrator [Syncfusion]
Replied On July 13, 2005 03:56 AM

In this case, I would probably try using a common grid. Especially if your datastructures as indexed (or something) so that the same QueryCellInfo/SaveCellInfo/QueryColCount/QueryRwoCount code will work just by changing one or two parameters. If these routines require a great deal of custimization for each tab, then I might be inclined to use a separate grid for the tabs that require customization. Additionally, if you choose to use a grid among two or more tabs, you would also have to add some data structures to hold information that you might want to persist between tab visits, like the current cell location, TopRowIndex, LeftColIndex and Selections.Ranges (and maybe other properties). Of course, if you use separate grids for each tab, you would not need to worry about persisting these properties.

CONFIRMATION

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.

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

;