Click here to Skip to main content
13,353,294 members (54,133 online)
Click here to Skip to main content

Stats

2.8M views
19.1K downloads
992 bookmarked
Posted 19 Jan 2003
MIT

SourceGrid - Open Source C# Grid Control

, 4 Aug 2013
SourceGrid is a free open source grid control. Supports virtual grid, custom cells and editors, advanced formatting options and many others features
SourceGrid2
References
SourceLibrary.dll
vssver.scc
SampleProject
App.ico
bin
Release
SampleProject.exe
SourceGrid2.dll
SourceLibrary.dll
Extensions
Add.ico
ArrowDown.ICO
ArrowUp.ICO
Delete.ICO
Refresh.ico
vssver.scc
Samples
CalcioSmall.bmp
FACE00.ICO
FACE01.ICO
FACE02.ICO
FACE04.ICO
new.bmp
vssver.scc
SourceGrid
BehaviorModels
vssver.scc
bin
Release
SourceGrid2.dll
SourceLibrary.dll
vssver.scc
Cells
vssver.scc
Common
Icons
CheckBoxChecked.ico
CheckBoxCheckedDisable.ico
CheckBoxCheckedSel.ico
CheckBoxUnChecked.ico
CheckBoxUnCheckedDisable.ico
CheckBoxUnCheckedSel.ico
clear.ico
copy.ico
cut.ico
DeleteCol.ico
DeleteRow.ico
InsertCol.ico
InsertRow.ico
paste.ico
properties.ico
SortDown.ico
SortUp.ico
Thumbs.db
vssver.scc
vssver.scc
DataModels
vssver.scc
Grid.bmp
Grids
vssver.scc
GridVirtual.bmp
SourceGrid2.snk
VisualModels
vssver.scc
SourceGrid
DemoProject
App.ico
bin
Release
DemoProject.exe
SourceGrid.dll
SourceLibrary.dll
FACE00.ICO
FACE01.ICO
FACE02.ICO
FACE04.ICO
new.bmp
PropertyStyleGrid
WorksheetStyleGrid
References
SourceLibrary.dll
SourceGrid
bin
Release
SourceGrid.dll
Cells
Models
PropertyStyleGrid
SourceGrid.snk
TypeCreator
Utility
Chris.Beckett.MenuImageLib
SubItem16.ico
Control
Controls
Icons
CheckBoxChecked.ico
CheckBoxCheckedDisable.ico
CheckBoxCheckedSel.ico
CheckBoxUnChecked.ico
CheckBoxUnCheckedDisable.ico
CheckBoxUnCheckedSel.ico
clear.ico
copy.ico
cut.ico
DeleteCol.ico
DeleteRow.ico
InsertCol.ico
InsertRow.ico
paste.ico
properties.ico
SortDown.ico
SortUp.ico
WorksheetStyleGrid
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

using Cells = SourceGrid2.Cells.Real;

namespace SampleProject
{
	/// <summary>
	/// Summary description for frmSample7.
	/// </summary>
	public class frmSample7 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Panel panel1;
		private SampleProject.Extensions.ListEditor listEditor1;
		private System.Windows.Forms.Splitter splitter1;
		private SampleProject.Extensions.GridBarChart gridBarChart1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public frmSample7()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.panel1 = new System.Windows.Forms.Panel();
			this.gridBarChart1 = new SampleProject.Extensions.GridBarChart();
			this.splitter1 = new System.Windows.Forms.Splitter();
			this.listEditor1 = new SampleProject.Extensions.ListEditor();
			this.panel1.SuspendLayout();
			this.SuspendLayout();
			// 
			// panel1
			// 
			this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
				| System.Windows.Forms.AnchorStyles.Left) 
				| System.Windows.Forms.AnchorStyles.Right)));
			this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.panel1.Controls.Add(this.gridBarChart1);
			this.panel1.Controls.Add(this.splitter1);
			this.panel1.Controls.Add(this.listEditor1);
			this.panel1.Location = new System.Drawing.Point(4, 4);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(760, 492);
			this.panel1.TabIndex = 1;
			// 
			// gridBarChart1
			// 
			this.gridBarChart1.BackColor = System.Drawing.SystemColors.Window;
			this.gridBarChart1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.gridBarChart1.Location = new System.Drawing.Point(259, 0);
			this.gridBarChart1.Name = "gridBarChart1";
			this.gridBarChart1.Size = new System.Drawing.Size(499, 490);
			this.gridBarChart1.StepNumber = 20;
			this.gridBarChart1.TabIndex = 4;
			// 
			// splitter1
			// 
			this.splitter1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
			this.splitter1.Location = new System.Drawing.Point(256, 0);
			this.splitter1.Name = "splitter1";
			this.splitter1.Size = new System.Drawing.Size(3, 490);
			this.splitter1.TabIndex = 2;
			this.splitter1.TabStop = false;
			// 
			// listEditor1
			// 
			this.listEditor1.Dock = System.Windows.Forms.DockStyle.Left;
			this.listEditor1.Editors = null;
			this.listEditor1.ItemType = null;
			this.listEditor1.List = null;
			this.listEditor1.Location = new System.Drawing.Point(0, 0);
			this.listEditor1.Name = "listEditor1";
			this.listEditor1.Properties = null;
			this.listEditor1.Size = new System.Drawing.Size(256, 490);
			this.listEditor1.TabIndex = 1;
			this.listEditor1.ListChanged += new System.EventHandler(this.listEditor1_ListChanged);
			// 
			// frmSample7
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.BackColor = System.Drawing.SystemColors.Control;
			this.ClientSize = new System.Drawing.Size(768, 499);
			this.Controls.Add(this.panel1);
			this.Name = "frmSample7";
			this.Text = "Bar Chart";
			this.Load += new System.EventHandler(this.frmSample7_Load);
			this.panel1.ResumeLayout(false);
			this.ResumeLayout(false);

		}
		#endregion

		private void frmSample7_Load(object sender, System.EventArgs e)
		{
			gridBarChart1.Bars.Add(new Extensions.ChartBar("Bar 1", 65, Color.Red, Color.White));
			gridBarChart1.Bars.Add(new Extensions.ChartBar("Bar 2", 70, Color.Silver, Color.Black));
			gridBarChart1.Bars.Add(new Extensions.ChartBar("Bar 3", 100, Color.Green, Color.White));
			gridBarChart1.Bars.Add(new Extensions.ChartBar("Bar 4", 80, Color.SteelBlue, Color.White));
			gridBarChart1.Bars.Add(new Extensions.ChartBar("Bar 5", 60, Color.LightGreen, Color.Black));
			gridBarChart1.LoadChart();

			listEditor1.List = new ArrayList(gridBarChart1.Bars);
			listEditor1.ItemType = typeof(Extensions.ChartBar);
			listEditor1.LoadList();
		}

		private void listEditor1_ListChanged(object sender, System.EventArgs e)
		{
			gridBarChart1.Bars.Clear();
			foreach (Extensions.ChartBar bar in listEditor1.List)
				gridBarChart1.Bars.Add(bar);

			gridBarChart1.LoadChart();
		}
	}
}

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 MIT License

Share

About the Author

Davide Icardi
Software Developer
Italy Italy
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180111.1 | Last Updated 4 Aug 2013
Article Copyright 2003 by Davide Icardi
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid