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

How can I suppress hidden columns/rows

Thread ID:





9906 Jan 15,2004 09:19 PM UTC Jan 16,2004 02:23 PM UTC WinForms 3
Tags: GridControl
MT Krishnan
Asked On January 15, 2004 09:19 PM UTC

How can I do the following in a GridControl 1. How can I suppress hidden columns/rows from being copied to the clipboard? 2. Copy the cell style (like font, BG/FG colour) to Excel? TIA for your help folks. Cheers, MTK

Administrator [Syncfusion]
Replied On January 16, 2004 08:57 AM UTC

1) You will have to handle things yourself. Handle ClipboardCopy and copy the cells you want to copy. Below is a try at this. 2) We will support copying BIFF (xls) in the grid in a future release through the new ExcelRW library that we are releasing as part of 2.0. We actually are trying to get this in the grid code for the 2.0 release itself, but since the work has not been completed yet, I am not sure if it will make this release or not. We eould like for it to be included, but just don''t know yet.

Administrator [Syncfusion]
Replied On January 16, 2004 08:59 AM UTC

I forgot to post the code snippet for 1. Here it is.
private void gridControl1_ClipboardCopy(object sender, GridCutPasteEventArgs e)
	GridRangeInfo range = e.RangeList.ActiveRange;
		range = range.ExpandRange(1,1, this.gridControl1.RowCount, this.gridControl1.ColCount);					string s = "";
		GridData data = this.gridControl1.Data;
		for(int row = range.Top; row <= range.Bottom; ++row)
				bool firstCol = true;
				for(int col = range.Left; col <= range.Right; ++col)
							s += "\t";
							firstCol = false;
						GridStyleInfo style = new GridStyleInfo(data[row, col]);
						s += style.Text;
				s += Environment.NewLine;
		e.Handled = true;

MT Krishnan
Replied On January 16, 2004 02:23 PM UTC

Thanks Clay. Thats simple and elegant. Cheers, MTK.


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