CastleSoft Posted June 10, 2015 Posted June 10, 2015 Does anyone have a snippet of how to add a custom field to the uniDBGrid ? I would like to add a URL which can be from a database calculated field. The OnDrawCell in DBGrid doesn't appear to have a Values property ? Like the uniGrid does ? I may have missed something ? (or I'm blind ?) Thanks Andrew Quote
mhmda Posted June 10, 2015 Posted June 10, 2015 Use field.ongettext in you table, for example: procedure TUniMainModule.qryTmpwerGetText(Sender: TField; var Text: string; DisplayText: Boolean); begin //you can use html also as text Text:='xxxxxxx'; end; Quote
Abaksoft Posted June 10, 2015 Posted June 10, 2015 Add your calculated Field directly on your sql statment. "Select ....,Field1 || Field2 as MyURLField From..." And declare MyURLField as a persistant Field (Data) on your ClientDataSet or QueryDataSet. I used this well in the past with UIB, as it don't support Calculated Field. Regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.