I would like to use the dragpoint tool to edit values in a datatable.
I have databound my point series to a datatable and use the dragpoint tool to change the values of the points. How do I get the changes of the points coordinates to write the data back to the datatable?
I have tried using the dragPoint_Drag event to detect a point value has changed. Within the event handler I have tried using the series.WriteToDataSource() method, but that does not seem to work.
Any suggestions?
I would like to bind to a DataView. Should I be able to bind to the DataView pretty much the same way as a datatable? I need to modify the values in the table using the dragpoint tool.
Dragpoint tool and binding to a datatable
-
- Advanced
- Posts: 192
- Joined: Thu Feb 01, 2007 12:00 am
- Contact:
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Re: Dragpoint tool and binding to a datatable
Hello Mike,
Something like the following seems to work as expected:Mike wrote: Any suggestions?
Code: Select all
private Points series1;
private DragPoint tool1;
private DataSet data;
private void InitializeChart()
{
tChart1.Series.Add(series1 = new Points());
series1.FillSampleValues(3);
tChart1.Tools.Add(tool1 = new DragPoint());
data = series1.DataSource as DataSet;
}
private void button1_Click(object sender, EventArgs e)
{
series1.WriteToDataSource();
data = series1.DataSource as DataSet;
DataTable table = data.Tables[0];
MessageBox.Show(table.Rows[0][1].ToString());
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/