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.
Unfortunately, activation email could not send to your email. Please try again.

Find functionality in GridControl ( Ctrl + F)

Thread ID:

Created:

Updated:

Platform:

Replies:

45839 Jun 29,2006 04:17 AM Aug 3,2006 12:14 PM Windows Forms 7
loading
Tags: GridControl
Ravichandran
Asked On June 29, 2006 04:17 AM

Hi, I want to implement the find ( Ctrl+F) functionality in GridCotrol. Pls let me give your thoughts/ideas. If I press Ctrl + F a small dialog window has to popup as in Notepad. Then if search string is there in grid then cursor has to point to that cell. Thanks Ravi

Administrator [Syncfusion]
Replied On June 29, 2006 11:33 AM

Hi Ravi, To implement the find ( Ctrl+F) functionality in a grid, you need to handle the CurrentCellKeyDown event. Here is a code snippet. private void grid1_CurrentCellKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if(e.KeyValue == 70 && e.KeyCode == Keys.F) { e.Handled = true; fr = new GridFindReplaceDialogSink(this.grid1); frDialog = GridFindReplaceDialog.Instance; frDialog.SetState(this.fr, "", false); frDialog.ShowDialog(); } } Here is a sample. http://www.syncfusion.com/Support/user/uploads/gridFindDialog_ca40e56.zip Let me know if this helps. Best Regards, Haneef

Ravichandran
Replied On July 13, 2006 04:48 AM

Hi Haneef, Thanks. It is working fine but is there any way to restrict or remove the vales displayed in combobox (Column only,Whole table and Section only) I just want only one option "Whole Table". And also is there any way to disable the Replace button bcos we dont need that for our application. Pls help me out Thanks Ravi >Hi Ravi, > >To implement the find ( Ctrl+F) functionality in a grid, you need to handle the CurrentCellKeyDown event. Here is a code snippet. > >private void grid1_CurrentCellKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) >{ > if(e.KeyValue == 70 && e.KeyCode == Keys.F) > { > e.Handled = true; > fr = new GridFindReplaceDialogSink(this.grid1); > > frDialog = GridFindReplaceDialog.Instance; > frDialog.SetState(this.fr, "", false); > frDialog.ShowDialog(); > } >} > >Here is a sample. >http://www.syncfusion.com/Support/user/uploads/gridFindDialog_ca40e56.zip > >Let me know if this helps. >Best Regards, >Haneef

Administrator [Syncfusion]
Replied On July 13, 2006 05:10 AM

Hi Ravi, Use this code snippet to hide the replace button and remove combobox item in a GridFindReplaceDialog. fr = new GridFindReplaceDialogSink(this.gridDataBoundGrid1); frDialog = GridFindReplaceDialog.Instance; frDialog.SetState(this.fr, "", false); //For diable the replace here 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); //Remove the ComboBox Select Item........ if( c is ComboBox) { if( c.Name == "comboBoxSelection" ) { ComboBox combo = c as ComboBox; System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection(); sc.Add("Whole Table"); combo.DataSource = sc; } } } frDialog.ShowDialog(); Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/gridFindDialog_ef28ef39.zip Let me know if this helps. Best Regards, Haneef

Administrator [Syncfusion]
Replied On July 13, 2006 05:22 AM

Hi Ravi, Sorry for the inconvenience caused. Here is a modified sample. http://www.syncfusion.com/Support/user/uploads/gridFindDialog_6f4b598f.zip Best Regards, Haneef

Ravichandran
Replied On July 13, 2006 05:52 AM

Thanks a lot Haneef... >Hi Ravi, > >Sorry for the inconvenience caused. > >Here is a modified sample. >http://www.syncfusion.com/Support/user/uploads/gridFindDialog_6f4b598f.zip > > >Best Regards, >Haneef >

Ravichandran
Replied On August 3, 2006 12:11 PM

Hi Haneef,

How to change the Find Form''s caption. By default it is coming as "GridFindReplaceDialog".

Pls reply asap.

Thanks & Regards
Ravi




>Thanks a lot Haneef...
>
>>Hi Ravi,
>>
>>Sorry for the inconvenience caused.
>>
>>Here is a modified sample.
>>http://www.syncfusion.com/Support/user/uploads/gridFindDialog_6f4b598f.zip
>>
>>
>>Best Regards,
>>Haneef
>>

Ravichandran
Replied On August 3, 2006 12:14 PM

Hi

Thanks.. I found the property to change the caption of find form.

Cheers
Ravi


>Hi Haneef,

How to change the Find Form''s caption. By default it is coming as "GridFindReplaceDialog".

Pls reply asap.

Thanks & Regards
Ravi




>Thanks a lot Haneef...
>
>>Hi Ravi,
>>
>>Sorry for the inconvenience caused.
>>
>>Here is a modified sample.
>>http://www.syncfusion.com/Support/user/uploads/gridFindDialog_6f4b598f.zip
>>
>>
>>Best Regards,
>>Haneef
>>

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.

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.

;