I use RadControls for WinForms Q2 2011.
I've set a column on my grid to ReadOnly for both EnterKeyMode and NewRowEnterKeyMode.
When navigating through cells with either Tab or Enter keys - it works fine and it jumps to the next editable cell. But, When navigating with Enter key on a new row through the read-only column - it stays on that cell and doesn't move on. I need to use Esc, arrows or mouse to release it.
Is it the right behavior? If so, is there some workaround for that?
Best Regards,
Boaz
11 Answers, 1 is accepted
Thank you for writing and sorry for the late response.
When you press the Enter key in EnterMovesToNextCell we always move to the next cell and we consider this behavior as normal. In case that the cell is read-only you cannot edit it and should press enter again.
You can easy workaround this behavior. You should CurrentColumnChanged event and skip the column if the column is ReadOnly:
this
.radGridView1.CurrentColumnChanged +=
new
Telerik.WinControls.UI.CurrentColumnChangedEventHandler(radGridView1_CurrentColumnChanged);
}
void
radGridView1_CurrentColumnChanged(
object
sender, Telerik.WinControls.UI.CurrentColumnChangedEventArgs e)
{
if
(e.NewColumn.ReadOnly)
{
int
nextIndex = e.NewColumn.Index + 1;
if
(nextIndex >=
this
.radGridView1.Columns.Count)
{
nextIndex = 0;
}
this
.radGridView1.CurrentColumn =
this
.radGridView1.Columns[nextIndex];
}
}
Please, refer to the attached project.
I hope this helps.
Kind regards,
Peter
the Telerik team
Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

1 ) I want to change position tab between cells by enter key but I can't
2) if tab was last cell, by enter key create new row and tab go to first cell in new row
tnx alot....
Thank you for writing.
1) In order to change the current cell with Enter key instead of the Tab key, you should set RadGridView's EnterKeyMode property to EnterMovesToNextCell:
radGridView1.EnterKeyMode = RadGridViewEnterKeyMode.EnterMovesToNextCell;
2) You should set RadGridView's NewRowEnterKeyMode property to EnterMovesToNextCell
radGridView1.NewRowEnterKeyMode = RadGridViewNewRowEnterKeyMode.EnterMovesToNextCell;
I hope this helps. Do not hesitate to contact us if you have other questions.
Regards,
Peter
the Telerik team
SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

i 'm taha
About Question 2 , So i could't create new row by enter key when tab
is last cell in last row
please help me.
tnx
You should set RadGridView's AllowAddNewRow property to true.
When set to true an empty row is added in which the user can enter data for the new record.
radGridView1.AllowAddNewRow =
true
;
I hope this helps. Kind regards,
Peter
the Telerik team

Thank you for writing.
I have to debug your custom logic in the CellFormatting and CellValueChanged events in order to find what causes this behavior. It is possible to send us a small build-able project where the issue can be reproduced? You can do that in a new support ticket.
A bit of topic, I would kindly ask you to open a new thread for each question that is not related to the main topic of the existing threads. This will avoid mixing several different topics in one thread, hence our community will be able to find information for the topics more easily in case it is interested.
Thank you for the understanding.
Greetings,
Peter
the Telerik team

I figured out what was causing the problem. In the CellValueChanged event, I called a method I wrote that sets the gridview's DataSource property to Nothing before reassigning it to a DataSet (in effect, clearing the gridview first). When I deleted the code line that assigned Nothing to its DataSource property, the problem was eliminated.
Thanks for your prompt reply, Peter.
Regards,
Curtis
Thank you for sharing this with us - I am happy that you managed to find a solution for this case.
Do not hesitate to contact us if you have other questions.
All the best,
Peter
the Telerik team

I'm facing a similar kind of issue when I try to enter a value in the cell and either use Tab or Enter. It works fine for both, but when I come back to the same cell and wants to change first entered value. I can change that value, but can't get out from that cell either by using Enter or Tab command or by clinking with mouse to another cell.
I have to use Escape key or F2 command to get out from that cell, but I lose my change, I don't want to use this Escape or F2 option.
Is there any solution via using Tab or Enter as it works first time?
Many Thanks
Ali
Thank you for writing.
Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the attached gif file illustrating the behavior on my end with the specified version. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem? Alternatively, you can submit a support ticket where you can provide all the necessary information together with a sample project demonstrating the problem. Thus, we would be able to investigate the precise case and assist you further. Thank you.
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik