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

Find Replace with custom cell format

Thread ID:





72409 Mar 18,2008 07:18 AM UTC Mar 19,2008 06:57 AM UTC WinForms 2
Tags: GridControl
Asked On March 18, 2008 07:18 AM UTC


I tried to implement Find Replace by GridFindReplaceDialogSink as sample, I found trouble for any cell with custom format like "#,###.##"
I have to enter '3,000' to find cell value of 3000


Administrator [Syncfusion]
Replied On March 19, 2008 12:47 AM UTC

Hi Harry,

Thank you for interest in Syncfusion products.

Please try the code below to solve this issue.

private void button1_Click_1(object sender, EventArgs e)
double t = Convert.ToDouble(this.textBox1.Text);
String s_text=String.Format("{0:#,####}", t);
GridCurrentCell cc;
public void textSearchInGroup(string text)
cc= this.gridControl1.CurrentCell;
if (cc.RowIndex == -1 || cc.ColIndex == -1)
this.gridControl1.CurrentCell.Activate(1, 1);
this.gridControl1.CurrentCell.Activate(cc.RowIndex, cc.ColIndex);
GridFindReplaceDialogSink frDialog = new GridFindReplaceDialogSink(this.gridControl1);
GridFindTextOptions option1 = GridFindTextOptions.WholeTable | GridFindTextOptions.MatchCase;
GridFindReplaceEventArgs frEventArgs = new GridFindReplaceEventArgs(text, "", option1, frLocationInfo);
GridRangeInfo frLocation = frDialog.Find(frEventArgs) as GridRangeInfo;
this.gridControl1[cc.RowIndex, cc.ColIndex].BackColor = Color.Yellow;

Please refer the attached sample for more details.

Please let me know if this helps.


Replied On March 19, 2008 06:57 AM UTC

Hi Srirajan,

I use GridGroupingControl with VB.net 2005.
String s_text=String.Format("{0:#,####}", t) -> didn't change 3000 to 3,000

the problem is that there can be part number field with plain format as 3000, 1000, etc. If I implement the sample code it won't find it.
The part number is string, and price is double. So how to make the it work for all?

Another problem is: if we click Find_All with option of WholeTable, it didn't work out (The background color didn't change).

Thanks & Regards,


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

This page will automatically be redirected to the 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