This is a migrated thread and some comments may be shown as answers.

After CellValidating Error is corrected and then Tab key is pressed, the next editable cells is skipped and focus is set to last editable cell in the grid

3 Answers 96 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ashwin
Top achievements
Rank 1
Ashwin asked on 19 Jan 2013, 11:54 AM
Hi,

I am using a RadGridView where I have two columns ,First columns where all Lables are dispalyed (This is a readonly column) and the Second column all the value can be entered some thing like below:
Description  Value
First Name : Tom
Last Name : Richarson
Passport Number: #########
Age : 12
Weight : 125 Pounds
DOB : mm/dd/yyyy

Actual:
I have a cell validating event where I have validation for Passport Number Value Field  that it has to be 9 digits , I am able to display the error message to the user when user enter less than 9 digits in the Passport Number Value Field   and tries to Tab out, then after the user enters a valid passport number and clicks on tab the focus to set to DOB value field.

Expected: When user enter a valid  Passport Number and clicks on tab then , focus should be set on next editable cell i.e. Age Value Field.

Any help or suggestion on how to fix this issue.


3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 21 Jan 2013, 02:32 PM
Hi Ashwin,

When edit mode is active RadGridView skips all columns marked as read only. You can make a column read only simply by setting its ReadOnly property to true:
this.radGridView1.Columns[0].ReadOnly = true;

You should handle CurrentCellChanged event when you want to exclude a column from being selected even when RadGridView is not in edit mode. Here is a sample:
void radGridView1_CurrentCellChanged(object sender, CurrentCellChangedEventArgs e)
{
    if (e.NewCell != null && e.NewCell.ColumnInfo.Index == 0)
    {
        this.radGridView1.CurrentColumn = this.radGridView1.Columns[1];
    }
}

However, it seems that in this scenario our RadPropertyGrid control will fit better. I recommend that you check its examples in our demo application.

Feel free to contact us if you need further assistance.
 
Greetings,
Jack
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Ashwin
Top achievements
Rank 1
answered on 28 Jan 2013, 07:27 AM
Hi Jack,
Thank you for your response, I am sorry for not explaining my problem correctly so let me try again,

I am using a RadGridView where I have two columns ,First column i.e (with header as  "Description") is a read only column and the Second column i.e(With header as "Value") has editable cells. I am using the EditorRequired event to create editors for each of the cells in second column with header as "Value".

Now coming to my problem, When I select first cell in "Value" column i.e (having value "Tom") and then click on Tab , it navigates me correctly to next editable cell (i.e cell having value "Richarson"), as expected. Again when I click on Tab it navigates me to next editable cell correctly, where I can enter a Passport Number(in below example depicted as  "#########"). Now in the Passport Number cell I have a validation where in user needs to enter 9 digit passport number (This is achieved using the CellValidating event). Now suppose the user just entered an eight digit Passport Number and clicked on Tab , then a validation message is displayed to the user and after the user clicks "ok" on the validation message focus remains in the Passport Number cell, now the user corrects the Passport Number and this time he enter a valid 9 digit Passport Number and clicks on Tab

Actual Result: When user corrects the Passport Number and clicks on Tab the focus is moved to the last cell in the "Value" column i.e "mm/dd/yyy" cell

Expected Result:When user corrects the Passport Number and clicks on Tab the focus should be set to below cell   in the same column i.e to cell having value "12" 
Description  Value
First Name : Tom
Last Name : Richarson
Passport Number: #########
Age : 12
Weight : 125 Pounds
DOB : mm/dd/yyyy


Hope I was able to expalin my problem more clearly and wating for your response on the same
0
Jack
Telerik team
answered on 28 Jan 2013, 03:09 PM
Hi Ashwin,

Thank you for this clarification. Now I understand the issue and I confirm that it appears when using our latest release. Due to the nature of the issue I was not able to find a proper work around. I logged it in our issue tracking system and it will be addressed in our upcoming release in February. I hope that timing is OK for you. I updated also your Telerik points accordingly. You can use the following link to track the issue status.

If you have other questions, do not hesitate to contact us.

Kind regards,
Jack
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
GridView
Asked by
Ashwin
Top achievements
Rank 1
Answers by
Jack
Telerik team
Ashwin
Top achievements
Rank 1
Share this question
or