[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

Grid with container as a datasource

NewBee

11/14/2005 8:02:00 PM

I have a class with a method that returns a container of data that I would
like to display in a grid. I've tried inserting the container's data into a
temporary table and using that as the grid's data source, but I can't seem to
nail down the syntax. Could someone post some sample code that might help,
or recommend a different way to accomplish this?

Thanks in advance!

2 Answers

Daniel Grau

11/15/2005 4:24:00 AM

0

try something like

//Populate tmpTable with your container-data
for(i=1; i<=conLen(_conYourContainer); i++)
{
LtabYourTmpTable.field1 = conPeek(_conYourContainer, 1);
...
...
LtabYourTmpTable.insert();
}

//'transfer' your tmpTable into the FormDataSource and show it
YourTmpTable_ds.setTmpDate(LtabYourTmpTable);
YourTmpTable_ds.executeQuery();

hope that helps


"Newbee" wrote:

> I have a class with a method that returns a container of data that I would
> like to display in a grid. I've tried inserting the container's data into a
> temporary table and using that as the grid's data source, but I can't seem to
> nail down the syntax. Could someone post some sample code that might help,
> or recommend a different way to accomplish this?
>
> Thanks in advance!
>

NewBee

11/15/2005 5:54:00 PM

0

That did the trick, with one small change:

changed "YourTmpTable_ds.setTmpDate(LtabYourTmpTable);"
to "YourTmpTable.setTmpDate(LtabYourTmpTable);"

Thank you!

"Daniel Grau" wrote:

> try something like
>
> //Populate tmpTable with your container-data
> for(i=1; i<=conLen(_conYourContainer); i++)
> {
> LtabYourTmpTable.field1 = conPeek(_conYourContainer, 1);
> ...
> ...
> LtabYourTmpTable.insert();
> }
>
> //'transfer' your tmpTable into the FormDataSource and show it
> YourTmpTable_ds.setTmpDate(LtabYourTmpTable);
> YourTmpTable_ds.executeQuery();
>
> hope that helps
>
>
> "Newbee" wrote:
>
> > I have a class with a method that returns a container of data that I would
> > like to display in a grid. I've tried inserting the container's data into a
> > temporary table and using that as the grid's data source, but I can't seem to
> > nail down the syntax. Could someone post some sample code that might help,
> > or recommend a different way to accomplish this?
> >
> > Thanks in advance!
> >