Link to home
Start Free TrialLog in
Avatar of tipvernonia
tipvernonia

asked on

Change datagrid view cell backgroud color based on color name stored in sql table

A color for each instrument is stored in the database.  i need to change the cell background base on the instrument color assignment.
Instrument1 color.lightGray
Instrument2 color.yellow
Instrument3 color.Blue

Celle(17) has the value "color.Blue"  which of couse is a string

 Me.dgvJobStatusHistory.Rows(e.RowIndex).Cells(3).Style.BackColor = Me.dgvJobStatusHistory.Rows(e.RowIndex).Cells(17).Value

Error:  Specific cast is invalid.

Any suggestions on how to store of convert would be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of nepaluz
nepaluz
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Imran Javed Zia
Imran Javed Zia
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tipvernonia
tipvernonia

ASKER

I do not really want to code for every color.  Previous solution from (nepaluz) works best for me.