Page 1 of 1

Runtime editor (DataSource)

Posted: Fri Dec 05, 2003 9:39 am
by 8123026
Hi,

i still try to edit the datasource of a series at runtime. I hope now, as a registered user, i can get the attention of someone monitoring this forum :).

Steema.TeeChart.Styles.Line series = new Steema.TeeChart.Styles.Line() ;
tChart.Series.Clear() ;
tChart.Series.Add( series ) ;
series.DataSource = dataSet ;
DataTable dt = dataSet.Tables[0] ;
series.LabelMember = dt.Columns[1].ColumnName ;
series.YValues.DataMember = dt.Columns[3].ColumnName ;

So far it works fine. The chart is displayed and shows the expected data.

But when showing the editor

Steema.TeeChart.Editors.SeriesEditor.ShowEditor( tChart[0], Steema.TeeChart.Editors.ChartEditorTabs.SeriesDataSource ) ;

i see two entries in the dataset combo box and the other fields are disabled. The two entries refer to (elements of) a strongly typed DataSet used in another part of the application and not to the anonymous dataset assigned a few statements before.

Has anyone an idea what is wrong here ?


Bernd F. Hoffmann

Posted: Wed Dec 10, 2003 1:15 pm
by Chris
Hi!
Has anyone an idea what is wrong here ?
Mmm. Well, I've tried to reproduce this problem here using the following steps:
1. Follow the steps in "Tutorial 8 - ADO.NET Database Access" -> Connecting to ADO.NET at design-time.
2. Right-click over oleDbDataAdapter1 and select "Generate Dataset.." .. rename the dataset "dataSet".
3. Paste the following code into the form:

Code: Select all

private void Form1_Load(object sender, System.EventArgs e)
{
  Steema.TeeChart.Styles.Line series = new Steema.TeeChart.Styles.Line() ; 
  tChart1.Series.Clear() ; 
  tChart1.Series.Add( series ) ; 
  oleDbDataAdapter1.Fill(dataSet,"Employee");
  DataTable dt = dataSet.Tables[0] ; 
  series.LabelMember = dt.Columns[1].ColumnName; 
  series.YValues.DataMember = dt.Columns[3].ColumnName; 
  series.DataSource = dataSet ; 
}

private void button1_Click(object sender, System.EventArgs e) {
  Steema.TeeChart.Editors.SeriesEditor.ShowEditor( tChart1[0], Steema.TeeChart.Editors.ChartEditorTabs.SeriesDataSource ) ; 
}
Everything seems to be working OK under these circumstances. Could you please verify that the above works OK for you? If you are still experiencing problems, could you please specify the exact steps I need to take to reproduce the problem here?