Use below code.
HTML
<asp:GridView ID="GVSectotal" runat="server" AutoGenerateColumns="true" Height="3px" Width="417px" OnRowDataBound="OnRowDataBound">
<RowStyle BackColor="#EFF3FB" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
Code
C#
protected void OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.BackColor = Color.White;
int actual_qty= int.Parse(e.Row.Cells[1].Text);
int target_qty= int.Parse(e.Row.Cells[2].Text);
if (actual_qty < target_qty)
{
e.Row.BackColor = Color.Red;
}
}
}
VB.Net
Protected Sub OnRowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.BackColor = Color.White
Dim actual_qty As Integer = Integer.Parse(e.Row.Cells(1).Text)
Dim target_qty As Integer = Integer.Parse(e.Row.Cells(2).Text)
If actual_qty < target_qty Then
e.Row.BackColor = Color.Red
End If
End If
End Sub