Page 1 of 1

Binding at design time Compact Framework

Posted: Thu Jun 20, 2013 12:29 pm
by 15665684
Hi

I am trying to bind a DataTable to a pie chart, but nothing is drawn what am I missing? Below is a snippet of the code.

Private Sub DrawPieChart(ByVal dt As DataTable)

Dim chart = GetChartObject()
_reportContent.Controls.Clear()
_reportContent.Controls.Add(chart)

Dim pieSeries As New Steema.TeeChart.Styles.Pie(chart.Chart)
pieSeries.YValues.DataMember = dt.Columns("PeriodUsage").ToString
pieSeries.LabelMember = dt.Columns("DeviceEndpointId").ToString
pieSeries.DataSource = dt
'pieSeries.CheckDataSource()

End Sub

Re: Binding at design time Compact Framework

Posted: Thu Jun 20, 2013 1:27 pm
by narcis
Hi jasmine,

Try uncommenting the CheckDataSource call. Did that help? You'll find some examples on the subject here and in Tutorial8 - ADO.NET Database Access. Tutorials can be found at TeeChart's program group.

If this doesn't help don't hesitate to let us know.

Re: Binding at design time Compact Framework

Posted: Thu Jun 20, 2013 1:34 pm
by 15665684
I tried it with pieSeries.CheckDataSource() not commented, but it did not help.

Right now I switch the code to draw the chart to

Dim count As Integer = 1
For Each row As DataRow In dt.Rows
pieSeries.Add(count, CDbl(row("PeriodUsage")), row("DeviceEndpointId").ToString)
count += 1
Next

This works fine but I prefer to use the bind option.
I am using VS 2008, with the Steema TChart .NET 2012

Re: Binding at design time Compact Framework

Posted: Thu Jun 20, 2013 1:35 pm
by narcis
Hi jasmine,

What about the examples at the thread I pointed in my previous reply and the tutorials?

If the problem persists can you please attach a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.