Hi
I'm Using this default for my grid. i want to change the row color for some condition in rad item databound. but it changing the row color.
when i mouse over the row of the changed color i'm getting default color that from (item Created) on mouse out i'm getting white color (item created) but i need that Changed color from item databound.
protected void Grd1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
GridItemType item = e.Item.ItemType;
switch (item)
{
case GridItemType.AlternatingItem:
case GridItemType.Item:
TableRow row = e.Item as TableRow;
string clr = "white";
row.Attributes.Add("onmouseover", "this.style.backgroundColor = 'Yellow';");
row.Attributes.Add("onmouseout", "this.style.backgroundColor = '" + clr + "';");
break;
}
}
protected void Grd1_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((e.Item.ItemType == GridItemType.Item) || (e.Item.ItemType == GridItemType.AlternatingItem))
{
string _No= grdScheduledPatients.MasterTableView.DataKeyValues[e.Item.ItemIndex]["Datakey"].ToString();
if (_No == "1")
{
e.Item.BackColor = System.Drawing.Color.Green;
}
}
}
Give me idea How to change the row color without change the old row color..
Regards,
Ashok Anbarasu
I'm Using this default for my grid. i want to change the row color for some condition in rad item databound. but it changing the row color.
when i mouse over the row of the changed color i'm getting default color that from (item Created) on mouse out i'm getting white color (item created) but i need that Changed color from item databound.
protected void Grd1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
GridItemType item = e.Item.ItemType;
switch (item)
{
case GridItemType.AlternatingItem:
case GridItemType.Item:
TableRow row = e.Item as TableRow;
string clr = "white";
row.Attributes.Add("onmouseover", "this.style.backgroundColor = 'Yellow';");
row.Attributes.Add("onmouseout", "this.style.backgroundColor = '" + clr + "';");
break;
}
}
protected void Grd1_ItemDataBound(object sender, GridItemEventArgs e)
{
if ((e.Item.ItemType == GridItemType.Item) || (e.Item.ItemType == GridItemType.AlternatingItem))
{
string _No= grdScheduledPatients.MasterTableView.DataKeyValues[e.Item.ItemIndex]["Datakey"].ToString();
if (_No == "1")
{
e.Item.BackColor = System.Drawing.Color.Green;
}
}
}
Give me idea How to change the row color without change the old row color..
Regards,
Ashok Anbarasu