+ 3

How to Display or highlight low inventory in Datagridview

Hi guys, i really don't understand how datagridview is going works. I want to Display or highlight a warning in a cell which have low inventory. Can u please check out this coding? Can anyone correct me? private void btnRefresh_Click(object sender, EventArgs e) { SqlCommand Command = new SqlCommand(); Command.Connection = connection; Command.CommandType = CommandType.Text; Command.CommandText = "SELECT* FROM dbo.Inventory_Details"; SqlDataAdapter SqlDataAdap = new SqlDataAdapter(Command); DataTable dtRecord = new DataTable(); SqlDataAdap.Fill(dtRecord); dataGridView1.DataSource = dtRecord; DataTable p_table = new DataTable(); connection = new SqlConnection("Data Source=DESKTOP-5D5BSR0;Initial Catalog=Suppliers;Integrated Security=True"); connection.Open(); SqlCommand command = new SqlCommand("Select Qty from Inventory_Details where qt < 25", connection);

29th Jun 2019, 5:05 AM
AB Rizni
AB Rizni - avatar
1 Resposta