Hi Mark/Tony
(Using MySQL->ASP->XML)
I am doing a project to define the grid from a database (like a grid contruction kit, with a backend). The data table to fill the grid will initially have 3 fields called col1,col2,col3 they will all be VARCHAR(30). We are not concerned with the datatype in the table it could be dates, integers, text, floats all wrapped around a varchar (you'll see why later)
All is working fine and indexing/sorting correctly based on text sorttype. Now i'm trying to define datatypes at grid level. (presume data is correct for now e.g. integer will only have strings of 0to9)
My next step is to allow col1,col2,col3 to be associated as integer/text/date in the backend database, so even though they are defined as VARCHAR(30) in the database, i thought i could use SORTTYPE to define how they are sorted at grid level.
For example: if col1 has 3 records with data:
1
10
2
When SORTTYPE set to INT, i was expecting
1
2
10
even though the data at database level is varchar
But i still get 1,10,2.
Is this possible, do i need to look at formatter module,to cast Varchars into a different type for sorting. Any advice or steering in the right direction would be helpful.
—
The reason i am not defining the datatypes at database level, is eventually this needs to be a generic system with upto 7 columns all based around a CATEGORY, each category will have a different set of data e.g. col1 could be an integer for categoryA, but col1 for CategoryB could be TEXT…and so on. SO i thought define them as Varchars and handle the types at grid level if possible. All the data is held in one table and when a user selects a category (dropdown combo) it reloads the grid framework and data defined by the currently selected category.
Regards
Mark C
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top