We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Alternating Rows in in table / Find text in a cell and change the cell format

Thread ID:





70313 Dec 6,2007 02:47 PM UTC Dec 7,2007 02:21 PM UTC WinForms 1
Tags: DocIO
Josue Medrano
Asked On December 6, 2007 02:47 PM UTC

Alternating Rows in in table / Find text in a cell and change the cell format

I've got an evaluation version of DocIO, I am trying to accomplish some requirements, so far most of then are fulfilled, however I'd like to expose the following questions:

1. Using MailMerge is it possible to change the format of the table alternating its Background color?

2. I have a PlainText in a cell (Table) which I would to find and then change the Background of the CELL where it is placed, is is possible to do it.

If yes, could please provide me an example of it.
I appreciate your help.

Best regards,
Josue Medrano

Global Wealth Management & Business Banking
Information Technology
Tel. +41-61-288 27 62
Fax +41-61-288 20 57


Fathima Shalini P [Syncfusion]
Replied On December 7, 2007 02:21 PM UTC

Hi Joshua,

Thanks for your interest in Syncfusion Products.

1) In mail merge to set the alternate backcolor in tables we need to set the backcolor in template document. DocIO does not support this at run time. Please do find

the simple sample that illustrates setting alternate background color using mail merge.


2) Please do find the simple sample in the following link that traces a text and finds the cell and changes its background color.


The following code snippet illustrates this.


public bool Find(string str)
int k = 1;
foreach(IWSection sec in document.Sections)
foreach (IWTable table in sec.Tables)

int r = table.Rows.Count;

for (int i = 0; i < r; i++)
int c = table.Rows[i].Cells.Count;
WTableRow r1 = table.Rows[i];
for (int j = 0; j < c; j++)
if (str.Equals(r1.Cells[j].Paragraphs[0].Text))
MessageBox.Show(str + " is found in " + (i + 1) + "Row " + (j + 1) + "Cell in Table" + k, "FindOnce");
r1.Cells[j].CellFormat.BackColor = Color.Blue;
return true;
return false;


Please try this and let me know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon