PDA

Click to See Complete Forum and Search --> : Query the data in a datagrid?? Help.


msuryadarma
Nov 9th, 2000, 08:08 AM
Hello everyone,

Okay, so I have ADODC and Datagrid. The table content is being displayed in the datagrid in a disconnected mode.

What I want to do is have a combobox with a list of the column names so that user can SORT the data whichever they like. I want to do this by not having to send a new query to the SQL Server, because that is slow. Is it possible?

In other words, I want the user to be able to SORT and RE-SORT the data that is being shown on the datagrid (as many times as they like), without sending a new query to the SQL Server.

So I want to be able to do something like:
"SELECT * FROM datagrid1.something ORDER BY colname"

Please post any thoughts or ideas, or anything at all. Thanks a lot.

Martin

AdrianH
Nov 10th, 2000, 06:24 AM
If you want to sort your grid using the result of your SQL call, and treat this data in isolation (not having to generate another query) then the only thing I can think of is loading the fields/rows returned from your SQL call to an array of UDT. Then sort the UDT Array.

I do this using with one app, using an unbound MSFlexGrid. I load the Array of UDT with the SQL call result then allow the user to sort the grid. All I do then is remove the records from the Grid, sort the UDT, and then re-build the Grid.

Adrian