[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

microsoft.public.axapta.programming

Force sort order in grid

Henke

12/20/2005 2:42:00 PM

Hi!

I have a grid in a form that displays data from a table. In the first column
I display a column from the table (let say a name) in the second coumn i
display a random number, calcualted in a display method. How could I have my
data sorted by the second column (the random number)? I think I have to
override the sort method on the column and than manipulate the data. But are
there any built in methods to use for this purpose?

Thanks!
/Henke


2 Answers

Luegisdorf

12/20/2005 3:21:00 PM

0

Hi Henke

As I know it is not possible to modify the sort method because it's done by
the kernel. And keep in mind that you have to read all data records first in
cache before you can sort them, this could take much time (depending on data
volume). Sorting by data base field only need the first - say 20 - records,
and only more if the user scrolls the grid and this saves load time.

If your display methods are based on a aggregate function (like count, sum,
a.s.o.) you could use a view instead a table as form data source (of course
this would be read only).

May be this helps
Best regards
Patrick

"Henke" wrote:

> Hi!
>
> I have a grid in a form that displays data from a table. In the first column
> I display a column from the table (let say a name) in the second coumn i
> display a random number, calcualted in a display method. How could I have my
> data sorted by the second column (the random number)? I think I have to
> override the sort method on the column and than manipulate the data. But are
> there any built in methods to use for this purpose?
>
> Thanks!
> /Henke
>
>
>

Henke

12/20/2005 4:15:00 PM

0

Thanks Patrick, using a view could be a solution. Right now I'm trying to
use a temporary table where I store my random numbers before displaying it
to the user.

/Henke

"Luegisdorf" <Luegisdorf@discussions.microsoft.com> skrev i meddelandet
news:9966DEDB-F112-4E9F-8517-8375D95025BA@microsoft.com...
> Hi Henke
>
> As I know it is not possible to modify the sort method because it's done
> by
> the kernel. And keep in mind that you have to read all data records first
> in
> cache before you can sort them, this could take much time (depending on
> data
> volume). Sorting by data base field only need the first - say 20 -
> records,
> and only more if the user scrolls the grid and this saves load time.
>
> If your display methods are based on a aggregate function (like count,
> sum,
> a.s.o.) you could use a view instead a table as form data source (of
> course
> this would be read only).
>
> May be this helps
> Best regards
> Patrick
>
> "Henke" wrote:
>
>> Hi!
>>
>> I have a grid in a form that displays data from a table. In the first
>> column
>> I display a column from the table (let say a name) in the second coumn i
>> display a random number, calcualted in a display method. How could I have
>> my
>> data sorted by the second column (the random number)? I think I have to
>> override the sort method on the column and than manipulate the data. But
>> are
>> there any built in methods to use for this purpose?
>>
>> Thanks!
>> /Henke
>>
>>
>>