Creating a custom DataGridColumnStyle in C#
Details Related Types
Site:  C#Today
Original URL:  http://www.csharptoday.com/content/articles/20010918.asp
Summary:
The .NET framework provides many unique controls like the DataGrid, which is a data bound list control that displays the items from a data source in a table. The DataGrid is the most powerful and flexible control in the .NET toolbox. In this article, Chad DePue takes a look at one aspect of the DataGrids flexibility, by creating a custom column. The DataGrid provides two types of columns for free, the DataGridTextBoxColumn and the DataGridBoolColumn, but there are many types of data that wont fit into either of these two column types. In the example given, we want to search a directory for icon (.ICO) files and display each icon as a row in the DataGrid. Neither of the existing column styles will do this for us, so we create our own.
System.Collections.IList
System.ComponentModel.IListSource
System.Data.DataSet
System.Data.DataTable
System.Drawing.Icon
System.Drawing.Rectangle
System.Drawing.Region
System.Drawing.Size
System.EventArgs
System.IO.DirectoryInfo
System.IO.FileInfo
System.Web.UI.WebControls.DataGrid
System.Web.UI.WebControls.ListBox
System.Web.UI.WebControls.TextBox
System.Windows.Forms.CurrencyManager
System.Windows.Forms.DataGrid
System.Windows.Forms.DataGridBoolColumn
System.Windows.Forms.DataGridColumnStyle
System.Windows.Forms.DataGridTableStyle
System.Windows.Forms.DataGridTextBoxColumn
System.Windows.Forms.ErrorProvider
System.Windows.Forms.Form
System.Windows.Forms.ListBox
System.Windows.Forms.NotifyIcon
System.Windows.Forms.TextBox
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com