I'm trying to change the background color of a row in a webgrid onmouseover on the client side. Is there a way to do this.
Thank you.
Hello,
You can use the ClientSideEvents of UltraWebGrid and use events MouseOverHandler="Over" MouseOutHandler="Out" . With javascript function over and out you can manipulate background of rows:
<ClientSideEvents MouseOverHandler="Over" MouseOutHandler="Out"/>
...
<script type="text/javascript" language="javascript">
function Over(gridNane, cellID, objectType){
var cell = igtbl_getCellById(cellID);
setRowBackColor(cell.Row, "red");
}
function Out(gridNane, cellID, objectType){
setRowBackColor(cell.Row, "white");
function setRowBackColor(row, color){
var cells = row.getCellElements();
for (var i = 0; i < cells.length; i++) {
cells[i].style.backgroundColor = color;
</script>
That worked perfectly. Thank you!