Click here to Skip to main content
15,893,161 members
Articles / Desktop Programming / Windows Forms

Excel Generator with Column Designer

Rate me:
Please Sign up or sign in to vote.
4.56/5 (27 votes)
8 Oct 2009CPOL2 min read 62.8K   2.2K   114  
A fully customizable and extensible C# library that makes it easy to generate Excel files for a given DataSet, with column layout design support.
/// FileName                : MappingNameConverter.cs
/// Author                  : Somnath Mondal
/// Created Date            : 10/03/2007
/// 
/// Modification History    :
/// **********************************************************************************************
/// Date        Author                          Description
/// **********************************************************************************************
/// 10/03/2007  Somnath Mondal.                 Created
/// **********************************************************************************************
using System;
using System.ComponentModel;

namespace Somsoft.ReportDesigner
{
	/// <summary>
	/// Implementation of StringConverter to get appropriate support in PropertyBrowser control.
    /// In a host such as a property browser in a forms designer, type converters allow a property value 
    /// to be represented as text to the user, and they can convert user-entered text into a value of 
    /// the appropriate data type. This class will return appropriate value and based on the value
    /// property browser decide which control needs to active for the current property value.
	/// </summary>
    public class MappingNameConverter : StringConverter
	{

		public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
		{
			//true means show a combobox
			return true;
		}

		public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
		{
			//true will limit to list. false will show the list, but allow free-form entry
			return true;
		}

		public override
			System.ComponentModel.TypeConverter.StandardValuesCollection
			GetStandardValues(ITypeDescriptorContext context)
		{
            // These standard values can be dropped down in the PropertyGrid at design-time
			return new StandardValuesCollection(GlobalFields.ListOfFields);
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions