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

search and replace operations in Grid Grouping Control.


Why the example does not work

search-and-replace operations in Grid Grouping Control.
please help



Attachment: test009dgw_3d62af35.rar

7 Replies

AR Arulpriya Ramalingam Syncfusion Team April 13, 2017 09:07 AM UTC

Hi Gregory, 

Thanks for contacting Syncfusion support team. 

We have analyzed your attached sample and we could able to reproduce your scenario. The button clicks events were not triggered for the buttons in the GridFindReplaceDialog dialog. The Button click event should be triggered to perform the actions OnButtonClick. We have hooked the events in GridFindReplaceDialog.Designer.cs file to achieve your requirement. Please make use of below code and modified attached sample, 

Code snippet 
 
this.ReplaceAllBtn.Click += new System.EventHandler(this.ReplaceAllBtn_Click); 
this.ReplaceBtn.Click += new System.EventHandler(this.ReplaceBtn_Click); 
this.cancelbtn.Click += new System.EventHandler(this.cancelbtn_Click); 
this.findallBtn.Click += this.findallBtn_Click; 
this.findnextBtn.Click += new System.EventHandler(this.findnextBtn_Click); 


Regards, 
Arulpriya 



GP Gregory Pe April 13, 2017 11:44 AM UTC

Hi Arulpriya
it works


I have a question

You would make GridFindReplaceDialog not go beyond Form1 - IsMdiContainer

Regards,
Gregory


AR Arulpriya Ramalingam Syncfusion Team April 13, 2017 01:06 PM UTC

Hi Gregory, 

Thanks for your update. 

The display position of the GridFindReplaceDialog can be set to center of the Parent Form by setting the FormStartPosition as CenterParent. Please make use of below code and sample, 

Code snippet 

// Displays the Find and Replace Dialog box. 
void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e) 
{ 
 
    if (e.Inner.Control) 
    { 
        if (e.Inner.KeyCode == Keys.F || e.Inner.KeyCode == Keys.H) 
        { 
            GridFindReplaceDialog f = new GridFindReplaceDialog(this.gridGroupingControl1, "Metro"); 
            f.StartPosition = FormStartPosition.CenterParent; 
            f.ShowDialog(); 
        } 
    } 
} 


Regards, 
Arulpriya


GP Gregory Pe replied to Arulpriya Ramalingam April 13, 2017 01:27 PM UTC

Hi Gregory, 

Thanks for your update. 

The display position of the GridFindReplaceDialog can be set to center of the Parent Form by setting the FormStartPosition as CenterParent. Please make use of below code and sample, 

Code snippet 

// Displays the Find and Replace Dialog box. 
void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, GridTableControlKeyEventArgs e) 
{ 
 
    if (e.Inner.Control) 
    { 
        if (e.Inner.KeyCode == Keys.F || e.Inner.KeyCode == Keys.H) 
        { 
            GridFindReplaceDialog f = new GridFindReplaceDialog(this.gridGroupingControl1, "Metro"); 
            f.StartPosition = FormStartPosition.CenterParent; 
            f.ShowDialog(); 
        } 
    } 
} 


Regards, 
Arulpriya


Hi Arulpriya
Thank you with quick feedback

That means you can not do anything like that

  GridFindReplaceDialog ChildForm = new GridFindReplaceDialog ();
             ChildForm.MdiParent = this;
             ChildForm.Show ();

To be in the area of Form1 ();

Regards,
Gregory


PM Piruthiviraj Malaimelraj Syncfusion Team April 14, 2017 07:38 AM UTC

Hi Gregory, 

Thanks for the update. 

In our previous update , we have provided the solution to show GridFindReplaceDialog  in center of the form. You can show the GridFindReplaceDialog by setting parent form for GridFindReplaceDialog. Please refer to the modified sample and let us know if you have any other queries, 
 
Code example: 
GridFindReplaceDialog f = new GridFindReplaceDialog(this.gridGroupingControl1, "Metro"); 
f.MdiParent = this.MdiParent; 
f.Show(); 

Sample link: 

Regards, 
Piruthiviraj 



GP Gregory Pe replied to Piruthiviraj Malaimelraj April 14, 2017 09:11 AM UTC

Hi Gregory, 

Thanks for the update. 

In our previous update , we have provided the solution to show GridFindReplaceDialog  in center of the form. You can show the GridFindReplaceDialog by setting parent form for GridFindReplaceDialog. Please refer to the modified sample and let us know if you have any other queries, 
 
Code example: 
GridFindReplaceDialog f = new GridFindReplaceDialog(this.gridGroupingControl1, "Metro"); 
f.MdiParent = this.MdiParent; 
f.Show(); 

Sample link: 

Regards, 
Piruthiviraj 


  Hi Piruthiviraj

GridFindReplaceDialog f = new GridFindReplaceDialog(this.M_RECEIPT_NON_STOCK_gridGroupingControl, "Metro");
                    f.MdiParent = this.MdiParent;
                    f.ShowDialog(); //f.Show();



Why does not work the method 
f.ShowDialog();
How can i do
ShowDialog() in this.MdiParent;

Regards,
Gregory



PM Piruthiviraj Malaimelraj Syncfusion Team April 17, 2017 08:48 AM UTC

Hi Gregory, 

Thanks for the update. 
 
As per your scenario, you are trying to use GridFindAndReplaceDialog as a child form of Form2. If you try to show the GridFindAndReplaceDialog by using “ShowDialog” , it will throws the exception “Form that is not a top-level form cannot be displayed as a modal dialog box. Remove the form from any parent form before calling showDialog”. The error tells the MDI child form is not a top-level form. Because we still need to interact with parent form. So the MDI child form can’t be shown as a modal dialog box. Please refer to the below forum, 

 
The recommended way to show the MDI child form is using the “Show” method instead of using “ShowDialog”.  
 
Please let us know if you have any other queries. 

Regards, 
Piruthiviraj 


Loader.
Live Chat Icon For mobile
Up arrow icon