mierlp Posted November 2, 2019 Share Posted November 2, 2019 hi I have a table called 'Status' with the following rows: - StatusID (autoinc) - Name (var) - Color (var) The user has to select a color for a certain status. Let say the follow status : - In progress = yellow - Done = green The selected color is saved in the field 'Color' and contains the color colde like '$0000B9FF' Now i would like to show in a DBgrid, see attachment: - the name - a big dot with the corresponding color from the field 'Color' How can i do this ? Link to comment Share on other sites More sharing options...
Sherzod Posted November 2, 2019 Share Posted November 2, 2019 54 minutes ago, mierlp said: How can i do this ? HI, I think there are many ways to do this. One of them has been suggested here: Link to comment Share on other sites More sharing options...
Sherzod Posted November 2, 2019 Share Posted November 2, 2019 1 hour ago, mierlp said: How can i do this ? If you only want to show, you can see this example: \FMSoft\Framework\uniGUI\Demos\Desktop\GridImages Link to comment Share on other sites More sharing options...
mierlp Posted November 2, 2019 Author Share Posted November 2, 2019 Hi Sherzod Thank you for the examples but I prefer not to work with images. You should also always include this with the installation and you have to make translation for the selected color and which image it it. Is there no other way. I am thinking, for example, of the use of ALT codes. Every new record receives this ALT code, which then has a standard white color. In the dbgrid the font size and color are adjusted to the value in the 'Color' field But no idea if that's possible and i solution Or is there a solution to based on a separate table which contains colored images / color code from the bullets and showing them in a dblookupcombobox...which is not possible i think? Regards Peter Link to comment Share on other sites More sharing options...
mierlp Posted November 2, 2019 Author Share Posted November 2, 2019 Hi I found a solution...what did i do : the field color contains the correct color for the bullet i created a calculated field called 'bullet' in the onCalcFields i added this code : dmStatus.StatusBooking.FieldByName('Bullet').value := '='; i added the field 'bullet' as a extra column to the uniDBgrid change the font.name for this column to 'webdings' <== important because now you got a nice big bullet change the font.size for this column to 20 <== then you got a nice big button uniDBgrid.OnDrawColumnCell i added this code : if ACol=1 then begin Attribs.Font.Color := uniDBgrid.Datasource.Dataset.FieldByName('Color').value; end; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now