Techno
06-28-2007, 07:29 AM
I have a gridview in ASP.NET. I want to be able to select a row onclick. I have done this and works fine - the selection is done on clientside (javascript)
what I would like to do now is to restore back the color of the previous row when the user clicks on another row. how is this possible?
current code I have for selecting a row:
function setMouseClick(element, currentRowIndex)
{
//I would imagine this comment would be the one to use to restore the previous rows
previousRowIndex = currentRowIndex
oldgridSelectedColor = element.style.backgroundColor;
element.style.backgroundColor = '#5A7EBF';
}
I want to be able to restore back the previous row color
what I would like to do now is to restore back the color of the previous row when the user clicks on another row. how is this possible?
current code I have for selecting a row:
function setMouseClick(element, currentRowIndex)
{
//I would imagine this comment would be the one to use to restore the previous rows
previousRowIndex = currentRowIndex
oldgridSelectedColor = element.style.backgroundColor;
element.style.backgroundColor = '#5A7EBF';
}
I want to be able to restore back the previous row color