Sortable Columns on Grid with Custom SQL not working

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Sortable Columns on Grid with Custom SQL not working

Post by bluttman »

Moveable, sizeable seem to be fine.
Sortable does work with program built subfile.

Any idea?

Thanks!
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Sortable Columns on Grid with Custom SQL not working

Post by Brian »

So you are using the custom SQL property to populate your grid? And you have the sortable columns property set to true? And the headings are listed in the column headings property?

What version of Profound UI are you using?
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Sortable Columns on Grid with Custom SQL not working

Post by Brian »

Ok, after rereading and thinking about your question, the answer is you are correct. Sorting will not work in this scenario.

When you use the DB properties to pull data into your grid, the Profound UI framework builds the SQL statement on the fly to retrieve the data. When you sort, it sticks an order by clause in the statement and pulls the data again.

when you use a custom SQL statement, the framework cannot insert the order by into the statement. Since the statement can't be reasonably altered and it has no idea how many records it would need to pull to sort after the fact, it simply doesn't allow it.

If you need a complex SQL statement to retrieve your grid data and want to sort there is another option. You can create an SQL view using your complex select statement. Then the normal DB properties can be pointed to your view instead of the table. Then sorting should work for you.
bluttman
Profound User
Posts: 35
Joined: Mon Feb 20, 2012 6:45 pm
First Name: Brian
Last Name: Luttman
Company Name: BEPCO, Inc.
Contact:

Re: Sortable Columns on Grid with Custom SQL not working

Post by bluttman »

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests