Matrix LoadFromDataSource

Eric Lapouge

Hello,

I'm trying to fill a matrix on a custom view, with data comming from a SQL query.

When I issue the call to LoadFromDataSource, th matrix remains empty.

If I try to fill it manually, then the rows are correctly added but nothing is shown.

I missed something?

Regards,

Eric

Attachment
[url=http://www.coresystems.ch/wp-content/../wp-content/forum-file-uploads/elapouge/SelectionMatrix.cs]SelectionMatrix.cs[/url]

Roberto Marra

Hi Eric,
Im not an expert, but did you update the form where is contained the matrix with a command
Form.Update()
or something like that?

Rgds
Roberto

Roberto Marra

Sorry Eric,
I didn't see that you posted the code...

Eric Lapouge

I've forgotten to give the SQL Query which I'm using... It's:
SELECT 0, CardCode, CardName, Balance, DNotesBal, OrdersBal FROM OCRD

I'm using a where clause, but I guess it has nothing to do with my current problem.

Regards,

Eric

Marco Schweighauser

Hello Eric,

the Matrix can not be filled by SQL queries. Only UserDatasources can be attached using the LoadFromDataSource method.

Please use the Grid component instead. The Grid offers you a ExecuteQuery() to fill it from a query result.


Kind regards,

Marco

Eric Lapouge

Hello Marco,

I know that I can't fill the Matrix from SQl queries.

I can't use the Grid, since I need the linkbutton object to each of the BP in resulting resultset.

I did an other try last night: create the form from ScreenPainter, then load it from the Framework and execute the query (I can evently change it before executing it. On my "final" version, I've just added an hack to change the WHERE clause of the query) and it works.

In this case, AFAIK I'm using a system data source and not a user's one.

From my readings of the Framework's documentation, I'm not limited to userDatasources.

Regards,

Eric
0

Comments

0 comments

Please sign in to leave a comment.

Didn't find what you were looking for?

New post