Hi All,
I want to deselect the row in DATAGRID. in ASP.NET application.
I was alredy selected in datagrid row .I want to change another row in same
datgrid .
Here in my datagrid was selected in Multiple rows. when ever i select the
particular row that time it can be selected .Next time i want to choose
another datagrid row that time in My application first row also
hilighted.(Here Multiple
rows selected) that should not happen
I want to Deselect first row in DataGrid.
I was done like this :
<script language="JavaScript">
var lastColorUsed;
function prettyDG_changeBackColor(row, highlight)
{
if (highlight)
{
lastColorUsed = row.style.backgroundColor;
row.style.backgroundColor = 'pink';
}
else
row.style.backgroundColor = lastColorUsed;
}
</script>
if(e.Item.ItemType==ListItemType.Item ||
e.Item.ItemType==ListItemType.AlternatingItem)
{
e.Item.Attributes["onmouseover"] =
"javascript:prettyDG_changeBackColor(this, true);";
e.Item.Attributes["onmouseout"] = "javascript:prettyDG_changeBackColor(this,
false);";
e.Item.Attributes["onclick"] = "javascript:prettyDG_changeBackColor(this,
true);";
}
Thank you
Karunakara Rao