Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Unable to add an Image to a cell using Javascript
posted

I am trying to add an Image to a cell in the WebGrid using javascript. The image does not show up.

Here is my code snippet:

var grid = igtbl_getGridById(gridid);	
	var rowCount = grid.Rows.length;
	var i = 0;
	
	if(rowCount > 0)
	{
		for( i = 0; i < rowCount; i++ )
		{
			if(grid.Rows.getRow(i).getCellFromKey("data").getValue() == strData)
			{
				grid.Rows.getRow(i).getCellFromKey("Img").BackgroundImage  = "../images/warning.gif";
				grid.Rows.getRow(i).getCellFromKey("Img").CssClass="warningOnGrid";				
			}
		}
	}