cancel
Showing results for 
Search instead for 
Did you mean: 

Grid Display Colors

Former Member
0 Kudos

Hi,

Is it possible to change the colors of alternate lines in the Grid display time for better readability.

Thanks,

Mahwish

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Actually, one of our customers requested this functionality.

I created a JS utility function for iGrids that gets called on Update Events. I don't recommend doing this as there is a bit of over head for only cosmetic gains. But, here it is:


/*=========================================================
// NAME:	formatGrid(objApplet)
// AUTH:	Ryan Miller at Infodatinc dot com
// DATE:	2007.03.20
// DESC:	Alternates row color of the referenced iGrid object
//===========================================================
// Revision History:
// #2007.03.20:rm - initial version
//=========================================================*/
function formatGrid(myApplet) {
	var myGrid = myApplet.getGridObject();
	var rowCount = myGrid.getRowCount();
	var colCount = myGrid.getColumnCount();
	
	for (var i=2; i<=rowCount; i=i+2) {
		for (var j=1; j<=colCount;j++) {
			myGrid.setCellBackgroundColor(i,j,myApplet.createColor("230,230,230"))
		}
	}
	myApplet.updateGrid(false);	
}

erik_schrampf
Active Participant
0 Kudos

Mahwish,

This is not currently an option built into the xMII Grids. A workaround would be to add another column to your dataset with either a 0 or 1 and then use the color contexting tab to match only the 0's to a certain color. You can then hide this column in the Grid template and this will give you the effect you want.

Erik