How to alternate the background color of each row in Web Grid in EP 4.0?


 In WebFormHTML class layoutgrid method, you can declare a boolean to check even or odd row and set the bgcolor ( ro style class) of the tr tag rendered.


 


For example


 





bEvenRow = false;


    for (row = 1; row <= rows; row++)


    {


        rowStr = int2str(row);


        if (dsos.cursor().RecId && moreRecords)


        {


        if ( bEvenRow == false)


        {


            #Output(‘<tr>’);


            bEvenRow = true;


         }


         else


         {


                     #Output(‘<tr BGCOLOR=”red”>’);


            bEvenRow = false;


 


         }


….