Binding at design time Compact Framework

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jasmine
Newbie
Newbie
Posts: 3
Joined: Wed Apr 24, 2013 12:00 am

Binding at design time Compact Framework

Post by jasmine » Thu Jun 20, 2013 12:29 pm

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

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

Re: Binding at design time Compact Framework

Post by Narcís » Thu Jun 20, 2013 1:27 pm

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.
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

jasmine
Newbie
Newbie
Posts: 3
Joined: Wed Apr 24, 2013 12:00 am

Re: Binding at design time Compact Framework

Post by jasmine » Thu Jun 20, 2013 1:34 pm

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

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

Re: Binding at design time Compact Framework

Post by Narcís » Thu Jun 20, 2013 1:35 pm

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.
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