Hi Luka,
Thank you for your interest in Syncfusion products.
You can achieve this task using GridFindReplaceDialog class, instead of using the formula. Please refer the code below for more details.
GridFindReplaceDialogSink fr;
private void buttonAdv1_Click(object sender, EventArgs e)
{
string SearchedText = string.Empty;
GridFindReplaceEventArgs fre;
GridFindReplaceDialog frDialog = GridFindReplaceDialog.Instance;
GridFindTextOptions options = GridFindTextOptions.MatchCase | GridFindTextOptions.MatchWholeCell;
object locInfo = GridRangeInfo.Table();
int rowIndex, colIndex;
fr = new GridFindReplaceDialogSink(this.gridControl1);
frDialog.SetState(this.fr, "", false);
frDialog.TopMost = false;
frDialog.TextSearched = SearchedText;
frDialog.TextSearched = "ABC";
GridCurrentCell cc = this.gridControl1.CurrentCell;
this.gridControl1.Model.Selections.Add(GridRangeInfo.Cell(cc.RowIndex, cc.ColIndex));
GridRangeInfo selRange = GridRangeInfo.Cells(1, 1, gridControl1.RowCount, gridControl1.ColCount);
int startTop = selRange.Top;
int startLeft = selRange.Left;
while (GridFindReplaceDialogSink.GetNextCell(selRange, ref startTop, ref startLeft, false, false))
{
GridStyleInfo style = gridControl1[startTop, startLeft];
GridCellRendererBase renderer = gridControl1.CellRenderers[style.CellType];
if (renderer.FindText(this.gridControl1[1, 1].Text, startTop, startLeft, options, true))
{
gridControl1.CurrentCell.GetCurrentCell(out rowIndex, out colIndex);
gridControl1[rowIndex, colIndex].BackColor = Color.Orange;
}
}
}
Please refer the code below that implements this task.
http://websamples.syncfusion.com/samples/Grid.Windows/F72008/main.htmNote:
When you click "Select Duplication of First Cell' button in the attached sample, then it will highlight the duplicate value of the first cell.
Please let me know if this helps.
Regards,
Srirajan