ProBindingSource as DataSource for UltraChart controls

Posted by Peter Judge on 05-Sep-2008 11:51

Hi,

There was a question some time ago (either on this forum or the TP2 forum), about using the ProBindingSource with the Infragistics UltraChart controls.

Unfortunately, it seems that the UltraChart has limited support for IBindingList objects (of which the PBS is one), and that only .NET DataTables are supported in that way.

Details at http://forums.infragistics.com/forums/t/9362.aspx

-- peter

All Replies

Posted by Admin on 09-Sep-2008 06:04

Don't see that as a big issue. Chars are rather static. They don't need to interact with TextBoxes etc. You don't update data in a Charts.

Now that we know, how it's supposed to be working, a dynamic temp-table to ADO.NET DataTable converter should be a matter of a quick coding exercise.

Posted by Admin on 14-Sep-2008 04:06

That is an interesting issue. Any C# expert could help us here.

Posted by Admin on 15-Sep-2008 03:12

It's not a C# matter More knowing the ADO.NET Objects...

What works (for a first prototype) should be:

TEMP-TABLE myTable:WRITE-XMLSCHEMA ("FILE", "temptable.xsd").

TEMP-TABLE myTable:WRITE-XML ("FILE", "temptable.xml").

DEFINE VARIABLE oDataSet AS System.Data.DataSet NO-UNDO.

DEFINE VARIABLE oDataTable AS System.Data.DataTable NO-UNDO.

oDataSet = NEW System.Data.DataSet ().

oDataSet:ReadXmlSchema ("temptable.xsd").

oDataSet:ReadXml ("temptable.xml").

oDataTable = oDataSet:Tables[0].

I could not test the syntax here - Shift-F2 does not with the PSDN editor.

But it should at least be close. oDataTable should be a reference to your table.

If you'd like to skip the xsd/xml export to files, export to LONGCHAR and import using String- or StreamReaders should work as well. Or directly manipulate the Columns collection of a datatable to create the meta schema.

Posted by Håvard Danielsen on 15-Sep-2008 13:05

There is a DataSet method in the DataServices/DataService.cls that is attached to batching and sorting sample.

http://www.psdn.com/library/thread.jspa?threadID=12083&tstart=0

You would need to call fetchData in the service before you can use it.

Note that it is fully possible that the xml approach that Mike shows above is faster (and better).

Posted by jmls on 14-Oct-2008 09:53

It's not a C# matter More knowing the ADO.NET

Objects...

What works (for a first prototype) should be:

TEMP-TABLE myTable:WRITE-XMLSCHEMA ("FILE",

"temptable.xsd").

TEMP-TABLE myTable:WRITE-XML ("FILE",

"temptable.xml").

DEFINE VARIABLE oDataSet AS System.Data.DataSet

NO-UNDO.

DEFINE VARIABLE oDataTable AS System.Data.DataTable

NO-UNDO.

oDataSet = NEW System.Data.DataSet ().

oDataSet:ReadXmlSchema ("temptable.xsd").

oDataSet:ReadXml ("temptable.xml").

oDataTable = oDataSet:Tables[0].

I could not test the syntax here - Shift-F2 does not

with the PSDN editor.

But it should at least be close. oDataTable should be

a reference to your table.

If you'd like to skip the xsd/xml export to files,

export to LONGCHAR and import using String- or

StreamReaders should work as well. Or directly

manipulate the Columns collection of a datatable to

create the meta schema.

So, we can't use a probinding source as a data source for a chart ?

That's a real shame. Has anyone tried to do this on beta2 ?

 * jmls goes off to try anyway

Posted by jmls on 14-Oct-2008 09:58

crap. Can't select the datasource.

Posted by jmls on 14-Oct-2008 10:18

Mmmmm. Got it working

Dropped an Ultrachart onto a form, used chart wizard to create a pie chart.

Dropped a Probinding control onto the form.

I then added a call to AddData() in the constructor. It works well.

Just got to figure out now where to get the labels from Any clues ?

Posted by jmls on 14-Oct-2008 11:37

um. wait. that's not right .. looks as if something is wrong somewhere. That's the trouble with using predictable data. (1,2,3,4,5) ...

Posted by jmls on 14-Oct-2008 13:36

Dammit, my optimism was misplaced. It does not work. Off to try another control ..

This thread is closed