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

GridFindAndReplaceDialog

I have searched the help files and have not been able to find a property/method/constructor to set or change the default value in the Selection comboBox when the dialog is shown. I am using versoin 2.1.0.9 of the grid. I want to use the combobox but it defaults to "Column Only" and I want it to default to "Whole Table". I am finding that users think the Find functionality is broken because they expect the find to work across the whole grid by default. From another post, I have used a hack to achieve what I want, but I was hoping there was a more appropriate, and future fullproof method of doing it. Here is the hack used just before showing the dialog: GridFindReplaceDialog dlg = GridFindReplaceDialog.Instance; foreach(Control c in dlg.Controls) { if(c is ComboBox && c.Name == "comboBoxSelection") { ((ComboBox)c).SelectedIndex = 0; } } Thank you for your time.

2 Replies

AD Administrator Syncfusion Team March 12, 2005 04:44 PM UTC

Hi Peter, the find replace dialog can be replaced with your own custom dialog. The key is that you provide an object that implements IGridFindReplaceDialogSink. You can for example take the source code found in grid source for GridFindReplaceDialog, copy/paste it into your application, rename it and use this dialog instead. In the attached example (modified from GridPad), this approach was taken. Now you can go in there and modify CustomFindReplaceDialog in the designer or just change default settings etc. You have full control over the appearance and behavior of the find replace dialog. The uploaded sample compiles with 2.1.0.9. For 3.x you will need to change references to 3.x assemblies. Then it should compile with 3.x GridPadWithCustomFindReplace.zip Stefan >I have searched the help files and have not been able to find a property/method/constructor to set or change the default value in the Selection comboBox when the dialog is shown. I am using versoin 2.1.0.9 of the grid. I want to use the combobox but it defaults to "Column Only" and I want it to default to "Whole Table". I am finding that users think the Find functionality is broken because they expect the find to work across the whole grid by default. From another post, I have used a hack to achieve what I want, but I was hoping there was a more appropriate, and future fullproof method of doing it. Here is the hack used just before showing the dialog: > >GridFindReplaceDialog dlg = GridFindReplaceDialog.Instance; >foreach(Control c in dlg.Controls) >{ > if(c is ComboBox && c.Name == "comboBoxSelection") > { > ((ComboBox)c).SelectedIndex = 0; > } > >} > >Thank you for your time.


AD Administrator Syncfusion Team March 17, 2005 03:35 PM UTC

Stefan, Thank you once again for your excellent support. Pete.

Loader.
Live Chat Icon For mobile
Up arrow icon