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. Image for the cookie policy date

Disable "replace" in GridFindReplaceDialog

Hi! How to disable the replace button in the GridFindReplaceDialog... or, If i cant, is there a way to popup a message like "Sorry, Replace function not implemented"? thanks! bye lobrys

9 Replies

AD Administrator Syncfusion Team August 10, 2004 03:44 AM

You can hide the buttons with code like this.
GridFindReplaceDialogSink findReplaceDialogSink;
public GridFindReplaceDialogSink GridFindReplaceDialogSink
{
	get
	{
		if (findReplaceDialogSink == null)
		{
			findReplaceDialogSink = new GridFindReplaceDialogSink(gridDataBoundGrid1);
			foreach(Control c in GridFindReplaceDialog.Instance.Controls)
			{
				if(c.Text.IndexOf("place") > -1)
				{
					c.Visible = false;
				}
			}
		}
		return findReplaceDialogSink;
	}
}
private void menuItem1_Click(object sender, System.EventArgs e)
{
	GridFindReplaceDialog frDialog = GridFindReplaceDialog.Instance;
	frDialog.SetState(GridFindReplaceDialogSink, "", false);
	frDialog.Text="Find";
	frDialog.Show();
}


AD Administrator Syncfusion Team June 6, 2006 03:18 PM

Hi, I''m using GridFindReplaceDialog to search my grid. How do i highlight the "found" cell. Currently, a frame appears around the cell Thanks Shankar


AD Administrator Syncfusion Team June 7, 2006 12:48 AM

Hi Shankar, Could you try this code to highlight the found cell in grid. Here is a code snippet. foreach(Control c in frDialog.Controls) { if(c.Text.IndexOf("place") > -1) { c.Visible = false; } if(c.Text.IndexOf("Find") > -1) { c.Click +=new EventHandler(c_Click); } } frDialog.ShowDialog(); private void c_Click(object sender, EventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; this.gridDataBoundGrid1.Model.Selections.Add(GridRangeInfo.Cell( cc.RowIndex,cc.ColIndex)); } Here is a sample. http://www.syncfusion.com/Support/user/uploads/gridFindDialog_447c4c71.zip Let me know if this helps. Best Regards, Haneef


RA Raj December 28, 2006 04:31 PM


The sample provided highlights the previously found values.

How can one highlight the current value searched by find dialog too?.

regards
Balaji
>Hi Shankar,
>
>Could you try this code to highlight the found cell in grid. Here is a code snippet.
>
>foreach(Control c in frDialog.Controls)
>{
> if(c.Text.IndexOf("place") > -1)
> {
> c.Visible = false;
> }
> if(c.Text.IndexOf("Find") > -1)
> {
> c.Click +=new EventHandler(c_Click);
> }
>}
>frDialog.ShowDialog();
>
>private void c_Click(object sender, EventArgs e)
>{
> GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
> this.gridDataBoundGrid1.Model.Selections.Add(GridRangeInfo.Cell( cc.RowIndex,cc.ColIndex));
>}
>
>Here is a sample.
>http://www.syncfusion.com/Support/user/uploads/gridFindDialog_447c4c71.zip
>
>Let me know if this helps.
>Best Regards,
>Haneef
>


RM Rekha Mallavarapu September 15, 2011 03:32 PM

Hi,

The example link posted is not available anymore. Can you provide a new link?

Also, Is it possible to highlight just the searching text inside a cell rather than highlighting the entire cell and all the value?

forexample, if there is a cell whihc has a value of "this is a test", and I am doing a search for "test" then in the cell, only the word "test" should be highlighted rather than the entire text( This is a test).

Any qould help would be great!

Thanks!



RB Ragamathulla B Syncfusion Team September 17, 2011 02:53 PM

Hi Rekha,

Thank you for the update.

You can highled text and cell using PrepareView event. The following code explains the same.

void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
GridControlBase grid = this.gridControl1.CurrentCell.Grid;

if (e.RowIndex > grid.Model.Rows.HeaderCount && e.ColIndex > grid.Model.Cols.HeaderCount
&& cc.HasCurrentCellAt(e.RowIndex, e.ColIndex))
{
e.Style.Interior = new BrushInfo(SystemColors.Highlight);
e.Style.TextColor = SystemColors.HighlightText;
e.Style.Font.Bold = true;
}
}

Please refer to the following sample which illustrate the same.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GridFindReplaceHighlight2074160074.zip

Let me know if you have any further concerns.

Regards,
Ragamathullah B.



RM Rekha Mallavarapu September 20, 2011 10:53 AM

test



RM Rekha Mallavarapu September 20, 2011 10:57 AM

Hi,

Is it possible to highlight only specific text from a cell rather than highlight the entire text in the cell. For example: If the cell text value is "This is a test". And I am searching for "test" in the table, then highlight only "test" inside the cell.

Thanks for your help!

Rekha




RB Ragamathulla B Syncfusion Team September 21, 2011 01:31 AM

Hi Rekha,

Thank you for update.

We will update details for your reported query in that incident 85084. Please refer the incident for better follow up. also We suggest you to logon your Direct trac account with your username and password to view your incidents.

Here is the link:

http://www.syncfusion.com:91/Support/DirectTrac/incidentview.aspx?incidentID=85084

Please let me know if you have further concerns.

Regards,
Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon