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.

How to get focus on invalid column

Thread ID:

Created:

Updated:

Platform:

Replies:

92846 Feb 8,2010 01:14 PM Feb 24,2010 12:50 PM Windows Forms 9
loading
Tags: Grouping
Bina Thakkar
Asked On February 8, 2010 01:14 PM

I have attached simple example with 4 columns. Code currently validates 2nd column (ServerIp) when new row is created. In case of invalid valid of ServerIp (valid is hardcoded to 'aa'), focus stays on the last column of newly entered row. It does not move to invalid column of newly entered row.

Thank you for the help,
Bina Thakkar



Sync_RowValidation_c8db1093.zip

Rajadurai C [Syncfusion]
Replied On February 12, 2010 08:57 AM

Hi Bina,

Thanks for your interest in Syncfusion Products.

To set the focus to the 2nd column of the newly added record in the attached sample, you can handle the following code in HandleCurrentRecordContextChange method after displaying the message box.

int index = this.gridGroupingControl.Table.AddNewRecord.GetRowIndex();
this.gridGroupingControl.TableControl.CurrentCell.MoveTo(index, 2);
this.gridGroupingControl.TableControl.CurrentCell.Activate(index, 2);
this.gridGroupingControl.TableControl.CurrentCell.BeginEdit();

Here is the modified sample for your reference.
http://help.syncfusion.com/support/samples/Grid.Windows/8.1.0.30/F92846.zip

Regards,
Rajadurai

Bina Thakkar
Replied On February 12, 2010 10:20 AM

Hi:

Sample code does work and I do get focus on invalid column. But values entered in other columns get wiped off. How can I give focus to invalid column but still retain values in other columns.

Thank you,
Bina Thakkar

Rajadurai C [Syncfusion]
Replied On February 16, 2010 09:12 AM

Hi Bina,

I have checked the reported behavior with the modified sample which i provided in my last update. It works as expected. When an invalid value is entered in that column and trying to move to next record, the focus remains in that invalid column and the values entered in the other columns remains uncleared. Please check this at your side and let me know with more details, if you faces the issue.

Regards,
Rajadurai

Bina Thakkar
Replied On February 16, 2010 11:02 AM

Hi:

1) =====================================
In the new row, modify columns:
Col1 (ServerName) = "aaa"
Col2 (ServerIP) = "aaa",
Col3 (HasBeenModified) = do not change value, just take cursor in the cell.

Result:Displays an error message box. Data in all columns in new row is blank

2) =====================================
In the new row, modify columns:
Col1 (ServerName) = "aaa"
Col2 (ServerIP) = "aaa",
Col3 (HasBeenModified) = true (modify from default value)

Result:Displays an error message box. Data is present in the row. But focus is in Col3 (HasBeenModified) and not in invalid column (Col2)

Hope this helps,
Thank you for all your help,
Bina Thakkar

Rajadurai C [Syncfusion]
Replied On February 18, 2010 10:33 AM

Hi Bina,

Thanks for the steps provided. However on following this, i couldn't reproduce the behavior you reported. It works as expected. I have tested it with our latest version 8.1.0.30. Here is the video file that shows the behavior.
http://help.syncfusion.com/support/samples/Grid.Windows/8.1.0.30/F92846a.zip

Please let me know if you have any further queries regarding this.

Regards,
Rajadurai

Bina Thakkar
Replied On February 19, 2010 11:28 AM

I am using .NET 3.5 and syncfusion version 7.403.0.20. Does it mean that I need to upgrade to v8 of syncfusion?

How can I get it to work on 7.403?

Thank you,
Bnia Thakkar

Rajadurai C [Syncfusion]
Replied On February 23, 2010 01:15 AM

Hi Bina,

I could able to reproduce the behavior you reported(cells other than invalid column get cleared in addnew row) in v7.403.0.20. It has been fixed internally through related fixes. However, this can be achieved in v7.403.0.20 by handling the following code in CurrentRecordContextChange event.

if (e.Action == CurrentRecordAction.CancelEditCalled)
e.Cancel = true;

Here is the modified sample for your reference.
http://help.syncfusion.com/support/samples/Grid.Windows/7.4.0.20/F92846a.zip

Regards,
Rajadurai

Bina Thakkar
Replied On February 23, 2010 07:34 AM

Hi:
Thank you for your update.

Following scenario is still not working.

2) =====================================
In the new row, modify columns:
Col1 (ServerName) = "aaa"
Col2 (ServerIP) = "aaa",
Col3 (HasBeenModified) = true (modify from default value)

Result:Displays an error message box. Data is present in the row. But focus is in Col3 (HasBeenModified) and not in invalid column (Col2).

Rajadurai C [Syncfusion]
Replied On February 24, 2010 12:50 PM

Hi Bina,

Thanks for your update.

With the solution i provided in my previous update, the issues reproduced in both the scenarios are found to be solved. I couldn't see any issue with the scenario2 on following steps provided.

Regards,
Rajadurai

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.

;