how to add a datagrid control on the teechart

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
am
Newbie
Newbie
Posts: 1
Joined: Wed Oct 27, 2004 4:00 am

how to add a datagrid control on the teechart

Post by am » Tue Dec 20, 2005 5:33 am

Development environment: C#, TeeChart Pro for Visual Studio .NET v1

Problem description: Many information must be displayed in the title of teechart. So we want to put a datagrid control on the teechart to show all the information friendly. When printing, the datagrid must be printed together with the teechart.

Question:Is there any solution to implement this feature?
Add a datagrid control on the teechart or other solution is acceptable.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Dec 22, 2005 12:31 pm

Hi am,

This feature is not available in TeeChart for .NET v1. However, it's available in TeeChart for .NET v2 using a standard System.Windows.Forms.DataGrid and this code:

Code: Select all

		private void Form1_Load(object sender, System.EventArgs e)
		{
			bar1.FillSampleValues();

			dataGrid1.DataBindings.Clear();		
			dataGrid1.SetDataBinding(bar1.DataSource, "TeeDataTable");
		}

		private void dragPoint1_Drag(Steema.TeeChart.Tools.DragPoint sender, int index)
		{
			bar1.WriteToDataSource();
			dataGrid1.SetDataBinding(bar1.DataSource, "TeeDataTable");
			dataGrid1.Update();
		}

		private void dataGrid1_CurrentCellChanged(object sender, System.EventArgs e)
		{
			bar1.CheckDataSource();
		}

		private void button1_Click(object sender, System.EventArgs e)
		{
			tChart1.Printer.Print();
		}
To print the DataGrid you may use any of the solutions below:


http://xmlfox.com/print_datagrid_net.htm
http://www.c-sharpcorner.com/Graphics/D ... nterMG.asp
http://www.knowdotnet.com/articles/printgriddemo.html
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply