Hi
Try this in server side grid databound
protected void gvDevice_RowDataBound(object sender, GridViewRowEventArgs e)
{
if ((e.Row.RowType == DataControlRowType.DataRow)) {
Image imgStatuss = e.Row.FindControl("imgStatus");
string status = DataBinder.Eval(e.Row.DataItem, "IPAddress");
try {
Ping ping = new Ping();
PingReply pingreply = ping.Send(status);
string reply = pingreply.Status;
if ((reply == 0)) {
e.Row.BackColor = Drawing.Color.Yellow;
} else {
e.Row.BackColor = Drawing.Color.Blue;
}
} catch (Exception ex) {
}
}
}
in above code i will get ip address form gridview and i ping ip address,i can ping that row change to yellow color,if not ping change to blue color.
i will get ip address from string status = DataBinder.Eval(e.Row.DataItem, "IPAddress");
i have ip address column in gridview and get that ip using e.Row.DataItem and assing in status,then i will ping ip address in status string,if it reply(successfully ping) 0 then row color change to yellow,i not get 0 then change to blue color
in ur excepetation get value form grid view and check that values and assign color for row
Regards
Aravind