DataGrid Cell Selection / Row Color
So I have been fighting this for a bit and Stack is not helping 😦
What im looking for is if a certain column in the database is 1 then have the datagrid show red background.
6 Replies
can you give more context? (a bigger picture of the code)
because from what i see, the issue is that a
DataGridView
doesnt have a member called Cell
what is does have is Rows[x].Cells
because a DataGridView
contains rows and columns, you need to specify the row, then you can select the cell from that
so, maybe something like this?
im not too sure though
someone who has more experience with c# than me might swing by and tear my code apart and better fix your issueCompiler Error CS1061 Does not contain definition.
can you give more? like the entire method?
that, plus what type
dataview
is, because im led to assume its DataGridView
dataview is the datagrid