this is for color alternate row.............
public void delcoloralternaterow()
{
mshtmlTable table = null;
mshtmlTableRow row = null;
mshtmlTableCell cell = null;
GetTableElement(out table, out row, out cell);
if (table != null)
{
try
{
HtmlElement table1 = getTableHTMLElement();
int count = 0;
foreach (HtmlElement row1 in table1.GetElementsByTagName("tr"))
{
if (count % 2 == 0)
{
row1.Style = "background-color: none";
}
count++;
}
}
catch (Exception ex)
{
throw new HtmlEditorException("Unable to colour the row", "Colour row", ex);
}
}
i just want to Alternate row colors should work on the rows below cursor ..
help me out to do this...

theLizardPosted Mar 29, 2015, 6:11 PM
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < tbl.Rows.Count; i++)
{
if (i % 2 == 0)
tbl.Rows[i].BgColor = Color.Red.ToString();
else
tbl.Rows[i].BgColor = Color.Blue.ToString();
}
}
}