Data Grid Row Color
-
for my requirement i want to change the colour of datagrid row by two colours alternatively, how can i achieve this requirement, also based on one column value yes or no, if no means i want to change the row colours please help for the two scenario Thanks in advance
-
-
for my requirement i want to change the colour of datagrid row by two colours alternatively, how can i achieve this requirement, also based on one column value yes or no, if no means i want to change the row colours please help for the two scenario Thanks in advance
-
Try with Code
function myColor(){ var i = this.getRowProperty("index"); return obj_data[i][9]; } obj.getColumnTemplate(0).setStyle("color", myColor);
Regards, Satips.
-
for my requirement i want to change the colour of datagrid row by two colours alternatively, how can i achieve this requirement, also based on one column value yes or no, if no means i want to change the row colours please help for the two scenario Thanks in advance
-
Write this code in ItemDataBound Event ----------------------------- LinkButton lbd = (LinkButton)e.Item.FindControl("lbDLI"); if (e.Item.FindControl("lbDLI") != null) { if (DataBinder.Eval(e.Item.DataItem, "LIVE") != null) // Here LIVE is column name in database { int i = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "LIVE")); if (i == 0) { lbd.Text = "Idle"; } else { lbd.Font.Bold = true; lbd.ForeColor = Color.Green; lbd.Text = "Live"; } } }
Regards, Mayank Parmar Senior Software Engineer Amba Tech Gandhinagar, India