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

Disable "replace" in GridFindReplaceDialog

Thread ID:

Created:

Updated:

Platform:

Replies:

17481 Aug 10,2004 06:17 AM UTC Sep 21,2011 05:31 AM UTC WinForms 9
loading
Tags: GridControl
Lobrys
Asked On August 10, 2004 06:17 AM UTC

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

Administrator [Syncfusion]
Replied On August 10, 2004 07:44 AM UTC

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();
}

Administrator [Syncfusion]
Replied On June 6, 2006 07:18 PM UTC

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

Administrator [Syncfusion]
Replied On June 7, 2006 04:48 AM UTC

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

Raj
Replied On December 28, 2006 09:31 PM UTC


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
>

Rekha Mallavarapu
Replied On September 15, 2011 07:32 PM UTC

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!


Ragamathulla B [Syncfusion]
Replied On September 17, 2011 06:53 PM UTC

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.


Rekha Mallavarapu
Replied On September 20, 2011 02:53 PM UTC

test


Rekha Mallavarapu
Replied On September 20, 2011 02:57 PM UTC

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



Ragamathulla B [Syncfusion]
Replied On September 21, 2011 05:31 AM UTC

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.


CONFIRMATION

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

;