i would like to ask how to change the row color in datagrid.

this is my codes.

that if my stock is < 10 the row with < 10 stock will turn in RED color.

If Val(medstocks.Text) < 10 Then
            MessageBox.Show("Medicine is running out of Stocks!", "WARNING", MessageBoxButtons.OK, MessageBoxIcon.Warning)


End If

..Thanks!

Recommended Answers

All 3 Replies

>i would like to ask how to change the row color in datagrid.

Set dataGridView1.Rows[0].DefaultCellStyle.BackColor property.

>i would like to ask how to change the row color in datagrid.

Set dataGridView1.Rows[0].DefaultCellStyle.BackColor property.

is it the same with datagrid only? thnks

>is it the same with datagrid only

Yes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.