Add these functions in the HTML section of the page
<script>
function ChangeColorOver(obj,clrO,clrC)
{
if(obj.style.backgroundColor!=clrC)
{
obj.style.backgroundColor=clrO;
}
}
function ChangeColorOut(obj,clrO,clrC)
{
if(obj.style.backgroundColor!=clrC)
{
obj.style.backgroundColor=clrO;
}
}
function ChangeColorClick(obj, clrO, clrC)
{
//--Delete lines from here if you want multiple selection
var tableID='DGshoppingHistory' //your datagrids id
var table;
if (document.all) table=document.all[tableID];
if (document.getElementById) table=document.getElementById(tableID);
if (table)
{
for ( var i = 1 ; i < table.rows.length-1 ; i++)
table.rows [ i ] . style . backgroundColor = "clrO";
}
//--Delete lines till here if you want multiple selection
obj.style.backgroundColor = clrC;
}
</script>
Write server side code on SelectedIndexChanged if you want to process the selected item
server side.