Is using the Flexgrid a requirement? As far as I know there is no way to auto format the data in a flex grid but this can be done easily in a DBGrid. Would you be able to use that instead?
Printable View
Is using the Flexgrid a requirement? As far as I know there is no way to auto format the data in a flex grid but this can be done easily in a DBGrid. Would you be able to use that instead?
He wants to CHANGE THE FONT.
Have you tried to write all the fields of the record instead of use the *
Example
SELECT Fieldname1, Fieldname2, Format(Fieldname3,"dd/mm/yyyy" ), Fieldname4 FROM ...
Edited to say FORMAT rather than FONT. Don't know what CG did to the edit...
Sorry for late replying, still suffer from sickness.
@jggtz: I have selected the fields to go to the list all by name. No "*".
I will try this:
SELECT Fieldname1, Fieldname2, Format(Fieldname3,"dd/mm/yyyy" ), Fieldname4 FROM ...
although I never saw something like a format statement embedded in an sql query. Thanks.
@DataMiser and David: I used MSHFlexGrid, because I was already familiar to it. I might try DataGrid if you say it can change the format for a column, but I have one thing in common to all lists in the program: I have made sorting occur when clicking on the column headers. Should be able to handle this in a similar way with DataGrid. I will take a look to that control, thanks.
Normal Flexgrid lets you intercept click events. Look for the FLOATING TEXTBOX examples to replace actual cells with input.
Right syntax
https://www.google.com.mx/#hl=es-419...iw=800&bih=457Code:SELECT Fieldname1, Fieldname2, Format(Fieldname3,'dd/mm/yyyy' ) As Exprname3, Fieldname4
FROM Tablename1
Why post TWICE?
Seems because there is a link now to the source of the information.
I don't need to change data while in grid view. It is only for display.
Ok, fine.
jggtz, your solution works perfect. I have to change the final query string just before I open the recordset, though, but this is a minor change in the end.
Very good. Thank you.
good work jggtz :thumb:
Unbelievable