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

gridGroupingControl TableControlCurrentCellValidating in MdiParent

How to control data injection in form1 to be different from table fom3
..
When entering a column of account text other than compact in the table "Pkacco" should open form3.
Then you should select the form3 record and rewrite the contents to form1 "Choose_button_Click"

Works fine when it triggers
  Form3 settingsForm = new Form3 (this, ccrow0);
                         settingsForm.Show ();
                         This.Enabled = false;

But already in midiParent not

ChildForm.MdiParent = this.MdiParent;
                         Enabled = false;
                         ChildForm.Show ();

How to do it in MdiParent.



Attachment: s_test2f_250dee0d.rar

13 Replies

MG Mohanraj Gunasekaran Syncfusion Team July 5, 2017 04:38 PM UTC

Hi Gregory, 

Thanks for contacting Syncfusion support. 

We have analyzed your provided sample. In your sample, you have tried to display the Form3 in TableControlCurrentCellValidating event. By default, GridGroupingControl does not allow to move the focus to next cell and not allow to close the form when error validation has enabled. Please find the below response for your queries, 

Query 
Solution 
Works fine when it triggers
  Form3 settingsForm = new Form3 (this, ccrow0);
settingsForm.Show ();
This.Enabled = false;
 
By this form initialization, it will act as a new form not depending on any Form. So, only the button click working in the Form3. 
Works fine when it triggers
Form3 settingsForm = new Form3 (this, ccrow0);
settingsForm.Show ();
This.Enabled = false;
 
By this code part, you have used the Form0 is the parent form of the Form3. So, if you have tried to enable the error validation using CurrentCell.SetError method then tried to show the Form3 in TableControlCurrentCellValidating event, it does not allow to any click action. So, only the button click not working in the Form2. 

 

Please let us know, do you have any specific reason to show the Form3 in TableControlCurrentCellValidating event. It will be helpful to provide our suggestion to resolve this scenario. 

Regards, 
Mohanraj G 



GP Gregory Pe July 6, 2017 08:34 AM UTC

Hi Mohanraj.

How to do it in MdiParent.
To not allow text "Form1" to be in
 
<Test009DataSet.Order_Details.Rows [_ccrow0 - 3] ["account"]>
Other than in the "Pkacco" column "account".
If there is one rekrd it writes:
If (rr == 1)
                
{
                    
First_check = false;
                    
E.Row ["account"] = this.test009DataSet.Pkacco.Rows [0] ["account"]. ToString ();
                    
E.Row ["Discount"] = this.test009DataSet.Pkacco.Rows [0] ["project"]. ToString ();

                    
First_check = true;
                
}
If there is no or more (> 1) it opens Form3 and the user selects the proposed records and presses "Choose_button".
Inserts into:
   
_form1.test009DataSet.Order_Details.Rows [_ccrow0-3] ["account"] = this.pkacco_gridGroupingControl.TableModel [this.pkacco_gridGroupingControl.Table.Records.IndexOf (record.Record) + 3, nField0account] .CellValue.ToString ();
              
If it gives up "Form3" the "Form3" is a cell in "Form1"
.test009DataSet.Order_Details.Rows [_ccrow0 - 3] ["account"] reports an error and can not let you quit editing unless you enter the correct data. Even if you press the "ESC"


Regards,

Gregory



AR Arulpriya Ramalingam Syncfusion Team July 9, 2017 03:51 PM UTC

Hi Gregory, 

Thanks for your update. 

We could understand your scenario. As we have updated earlier, if you enable the error message for cell validation using CurrentCell.SetError method, the current cell focus will not be lost until a valid value is entered in the cell as this the behavior. So, the focus will not be moved to button of form3 and the button click will not be triggered even when the button is clicked. 

Arulpriya 



GP Gregory Pe replied to Arulpriya Ramalingam July 10, 2017 05:09 PM UTC

Hi Gregory, 

Thanks for your update. 

We could understand your scenario. As we have updated earlier, if you enable the error message for cell validation using CurrentCell.SetError method, the current cell focus will not be lost until a valid value is entered in the cell as this the behavior. So, the focus will not be moved to button of form3 and the button click will not be triggered even when the button is clicked. 

Arulpriya 


Hi Arulpriya

How to do it in MdiParent.

How to do scenario using a different  method


Regards,
Gregory



AR Arulpriya Ramalingam Syncfusion Team July 12, 2017 12:00 PM UTC

Hi Gregory,   
  
Thanks for your update.   
  
By default, the CurrentCellValidating event will be triggered only when a valid value is entered in the cell and until then the CurrentCellValidating event will not allow actions in MDI Child form. This is the default behavior of CurrentCellValidating event with MDI Parent and MDI Child form. Since the validation fails in the CurrentCell of grid which is placed in the Parent form, its child MDI form will not be allowed to perform any operation. We had posted your query in MSDN forum. Please refer to the below MSDN forum.   
  
   
Note: If the ChildForm is opened as a new form (not opened as MDI Child form), the focus will be moved to the new form and it does not depend on the parent form. Then you can perform the actions in child form.  For example, if the Form3 is opened as normal form, then the focus will be moved to new Form3, and the button click event will be triggered. If the ChildForm is opened in MDI parent container, then the focus will be in the same form (i.e. in Form1) since a new form was not opened.   
  
Regards,   
Arulpriya   



GP Gregory Pe replied to Arulpriya Ramalingam August 14, 2017 04:45 AM UTC

Hi Gregory,   
  
Thanks for your update.   
  
By default, the CurrentCellValidating event will be triggered only when a valid value is entered in the cell and until then the CurrentCellValidating event will not allow actions in MDI Child form. This is the default behavior of CurrentCellValidating event with MDI Parent and MDI Child form. Since the validation fails in the CurrentCell of grid which is placed in the Parent form, its child MDI form will not be allowed to perform any operation. We had posted your query in MSDN forum. Please refer to the below MSDN forum.   
  
   
Note: If the ChildForm is opened as a new form (not opened as MDI Child form), the focus will be moved to the new form and it does not depend on the parent form. Then you can perform the actions in child form.  For example, if the Form3 is opened as normal form, then the focus will be moved to new Form3, and the button click event will be triggered. If the ChildForm is opened in MDI parent container, then the focus will be in the same form (i.e. in Form1) since a new form was not opened.   
  
Regards,   
Arulpriya   


Hi Arulpriya;

Change by proposal

It's pretty good but I can not choose Choose_button on Form 3
And insert values into Form1

Please help in how to solve the scenario

Possibly how else to do it otherwise
Regards,
Gregory


Attachment: s_test2f_250dee0d_8e62f058.rar


MG Mohanraj Gunasekaran Syncfusion Team August 15, 2017 02:36 PM UTC

Hi Gregory, 
 
Thanks for your update. 

If you want to access the form when validating the CurrentCell, you should create a new form to update the valid value. If you use the Form3 as child form of the parent form(Formm2) and try to show in CurrentcellValidating event which not allow to make any action in Form3 because CurrentCell validation does not allow to change focus to other dependent form, up to update the valid value for current cell. This is our current behavior of GridGroupingControl. So, there is only way to use the new form to update the cell value not to use MDIParent to set Form2 as a parent form for Form3. 

Regards, 
Mohanraj G 



GP Gregory Pe August 21, 2017 06:17 PM UTC

Hi Mohanraj .

How to force the focus to return to the abandoned cell before opening Form3.


             if ((ss == 0) && output.Length > 0)
                {
                    GridTextBoxCellRenderer renderer1 = this.gridGroupingControl1.TableControl.CurrentCell.Renderer as GridTextBoxCellRenderer;
                          
                    if (ChildForm3 == null)
                    {
                        renderer1.TextBox.Text = null;

                        this.gridGroupingControl1.TableControl.CurrentCell.ActivateOnGotFocus = true;
                        this.gridGroupingControl1.TableControl.CurrentCell.MoveTo(ccrow0, cccol0, GridSetCurrentCellOptions.SetFocus);
                        this.gridGroupingControl1.TableControl.CurrentCell.Activate(ccrow0, cccol0, GridSetCurrentCellOptions.SetFocus);
                        this.gridGroupingControl1.TableControl.CurrentCell.BeginEdit();

                        ChildForm3 = new Form3(this, ccrow0);
                        ChildForm3.MdiParent = this.MdiParent;
                         Enabled = false;
                        ChildForm3.Show();
                       

                        this.CellValidating_label.Text += " -";
                        e.Inner.Cancel = true;
                    }

                    else
                    {
                        if (ChildForm3.IsDisposed)
                        {                         
                            renderer1.TextBox.Text = null;

                            this.gridGroupingControl1.TableControl.CurrentCell.ActivateOnGotFocus = true;
                            this.gridGroupingControl1.TableControl.CurrentCell.MoveTo(ccrow0, cccol0, GridSetCurrentCellOptions.SetFocus);
                            this.gridGroupingControl1.TableControl.CurrentCell.Activate(ccrow0, cccol0, GridSetCurrentCellOptions.SetFocus);
                            this.gridGroupingControl1.TableControl.CurrentCell.BeginEdit();

                            ChildForm3 = new Form3(this, ccrow0);
                            ChildForm3.MdiParent = this.MdiParent;
                            Enabled = false;
                            ChildForm3.Show();
 
                            e.Inner.Cancel = true;
                        }
                        else
                        {
                            ChildForm3.Activate();
                            renderer1.TextBox.Text = null;
                            this.CellValidating_label.Text += " @";
                        }
                  
                        this.gridGroupingControl1.TableControl.CurrentCell.SetError(" Please enter valid 456");
                        e.Inner.Cancel = true;
                    }
                }




Attachment: s_test2f_45f744dd.rar


PM Piruthiviraj Malaimelraj Syncfusion Team August 22, 2017 02:09 PM UTC

Hi Gregory, 

Thanks for your update, 

We have analyzed your scenario and code snippet. It seems that you have handled it correctly for changing the current cell focus. Whenever the new form (Form3) get opened the focus will be moved to that form, after changing the current cell focus of grid in Form1. So please let us know the reason of changing the current cell focus before opening Form3. It would be more helpful for us to provide the better solution at the earliest. 

Regards, 
Piruthiviraj 



GP Gregory Pe replied to Piruthiviraj Malaimelraj August 22, 2017 04:48 PM UTC

Hi Gregory, 

Thanks for your update, 

We have analyzed your scenario and code snippet. It seems that you have handled it correctly for changing the current cell focus. Whenever the new form (Form3) get opened the focus will be moved to that form, after changing the current cell focus of grid in Form1. So please let us know the reason of changing the current cell focus before opening Form3. It would be more helpful for us to provide the better solution at the earliest. 

Regards, 
Piruthiviraj 


When I click the mouse next works properly.
But when pressed the TAB does not behave properly does not return



MG Mohanraj Gunasekaran Syncfusion Team August 23, 2017 02:33 PM UTC

Hi Gregory, 
 
Sorry for the inconvenience caused. 
 
We are little bit unclear about your scenario because cell validation should not allow the cell focus to change another cell when cell has no valid value. So, can you please confirm whether you are want to allow the selection and tab key navigation when cell validation has enabled. Then, only we can proceed further. Please refer the below screenshot, 
 
 
Screenshot 
Mouse click, 
 
 
While pressing tab key, 
 
 
 
 
Regards, 
Mohanraj G 
 
 



GP Gregory Pe replied to Mohanraj Gunasekaran August 23, 2017 06:00 PM UTC

Hi Gregory, 
 
Sorry for the inconvenience caused. 
 
We are little bit unclear about your scenario because cell validation should not allow the cell focus to change another cell when cell has no valid value. So, can you please confirm whether you are want to allow the selection and tab key navigation when cell validation has enabled. Then, only we can proceed further. Please refer the below screenshot, 
 
 
Screenshot 
Mouse click, 
 
 
While pressing tab key, 
 
 
 
 
Regards, 
Mohanraj G 
 
 


Hi Mohanraj.

The movie I show it works:
1.
Step one - "123"
Mouse clik on the selected line - is ok
2.
Step two - "234"
The mouse clik - in another line - is wrong - should not let you go beyond the line
3.
Step Three - "345"
Pressing tab key, - goes on - wrong
4.
Step Four - "456"
Pressing ENTER key, - is ok
5.
Step Five - "a11"
Properly. - OK


  1
I would like to enjoy the same as in the fourth step "456"
Did not go out of line
  2
In addition, at the opening of Form3, the proposed text would be "123", "234", "345", "456" in the Form1 validated field.
Until another value is inserted.
But I do not know how to do it


Attachment: 20170823_at_192551_5a3b482e.rar


MG Mohanraj Gunasekaran Syncfusion Team August 24, 2017 01:26 PM UTC

Hi Gregory, 
 
Thanks for your update. 
 
We have created an incident regarding your query and updated the response through the incident. So, please follow up with that incident using your login, 
 
 
Regards, 
Mohanraj G 


Loader.
Up arrow icon