Binding [Control].ForeColor to a DataSet.Column

csharpener

Member
Joined
Aug 11, 2003
Messages
13
Hi all,

Can anyone help with this?

I have a WINDOWS form that contains a DataGrid and 20 odd TextBoxes on it. Both the grid and textboxes are databound to a dataset created at runtime to join 6 SQL Database tables. A field held in the single DataSet holds a string value relating to the context of that particular row. The user wants to view any row with a particular context in RED wherever it appears on the form... so if there are twenty "F" contexts in the grid, these rows will be colored red and the others will be black. If the user selects a red row in the grid, the data displayed in the textboxes will be red too.

I have tried creating an extra column in the dataset to hold a System.Drawing.Color.Value and binding each controls ForeColor property to that, but cant seem to store an object like that in the dataset. Storing the color as a string throws a "cannot convert __blah_blah" error. Does anyone understand what Im trying to do and have some way of making it happen ? :)

Cheers if u can help
CS
 
Back
Top