cancel
Showing results for 
Search instead for 
Did you mean: 

My matrix cannot handle float values

lars_jnsson
Active Participant
0 Kudos

My matrix handled my float columns ok when I used DBDataSource. But after I changed to DataTable (a must since i need data from 3 tables) the float values becomes rubbish in the matrix.

After ExecuteQuery I inspect the datatable and the values are correct and with correct type (System.Double).

After Matrix.LoadFromDataSource() the float columns shows rubbish tokens (like chinese).

After Matrix.FlushToDataSource() I inspect the datatable again => now all float values has values like 9007336695,79165.

What is wrong? Do I have to convert all values in the select statement to varchar to get it work?

Regards

Lars Jönson

Accepted Solutions (0)

Answers (3)

Answers (3)

lars_jnsson
Active Participant
0 Kudos

Thank you both for your answers. I'm glad to hear that this is my main problem, that I must rebind my columns after each query.I consider this a bug in the Matrix or EditText, because it's only the float columns that have to be rebind.

On the other hand it is sad that I have to spend 2 days trying to find out why my code is not working while the answer is "common knowledge" among experienced SDK-programmers. I'm a newbie on the SDK but have worked 20 years with system development. My experience with the SDK is that is "big" but too many things has to be done in a certain way that is undocumented and not obvious.

My opinion about the SDK is:

1) too old fasioned technology (COM),

2) poor documentation, a book (in brick format!) is needed

3) only elementary samples, more advanced samples are needed

But the forum is a lifeline, how can we live without it????

Don't hesitate to comment this!

Regards

Lars Jönson

LittleFish, Sweden

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Lars,

Thanks for the comments. I will pass the comment to development team.

You hit the point. Knowledge management is pretty citical.

Online help is knowledge base of basic topics, it is useful for basic topic and newbie.

However, as you mentioned the Forum (community) is a great place for networking and advanced topics etc. That is the initative and value of the forum community. Thanks.

Kind Regards

-Yatsea

lars_jnsson
Active Participant
0 Kudos

All folks seems as much confused as I am...

I have to change my opinion. The problem is that the float values become strange after a new ExecuteQuery in the DataTable. But if i rebind the float columns after each ExecuteQuery it works!!!

String and Int columns has never been a problem.

Regards

Lars

Former Member
0 Kudos

My standard approach to load DataTable-Matrixes is always in the following order:

1. Matrix. and DataTable.Clear

2. DataTable.ExecuteQuery(query)

3. Binding Mtx-Cols to DataTable

4. Matrix.LoadFromDataSource

I don't know if it's the best way but it works...

Cheers,

Roland

PS.:

IIRC I had some weird display problems when the Matrix.Column-Property ".DisplayDesc" was set to true (or vice versa...). It may worth a short test and play around with that...

Edited by: Roland Toschek on Nov 6, 2008 5:58 PM

Former Member
0 Kudos

Lars,

its standard behaviour. Before each query Im unbinding it as

omatrix.Clear()

For q = 0 To oMatrix.Columns.Count - 1

If oMatrix.Columns.Item(q).DataBind.DataBound Then oMatrix.Columns.Item(q).DataBind.UnBind()

Next q

and then bind it again. This problems occurs not everytime, but occasionaly and rebindinding the columns works for me in all cases.

lars_jnsson
Active Participant
0 Kudos

After tooooo many hours I have finally found the problem: it is about binding columns.

As I wrote I started to use a DBDataSource and when creating the matrix and its columns I also do the binding with SetBound before the DBDataSource is loaded with the data.

After switching to DataTable it's not possible to bind with Bind() when the DataTable is empty.

Therefore I made this dirty trick: I loaded the DataTable with my select but using a where-condition that resulted in 0 rows.

By doing this the DataTables columns are populated with the correct information and it's possible to do the binding in the matrix. But this also is the cause why the float values is represented with rubbish tokens after loading the DataTable with a correct row. If I wait with the binding process until there is data in the DataTable it will work ok.

I consider this a bug in the matrix!

Now I have to solve when and how to do the binding. My form is started empty in the ADD mode and must be able to work when my tables are empty. It looks like the problem with the hen and the egg, which came first?

Any suggestions anybody?!

Regards

Lars Jönson