
Kevin Meyer
Top achievements
Rank 1
Kevin Meyer
asked on 25 Aug 2008, 08:49 PM
I have a requirement to set focus to a particular cell in edit mode (with the editor created, visible, and with focus). Any assistance is greatly appreciated.
9 Answers, 1 is accepted
0
Hi Kevin Meyer,
Unfortunately, we did not manage to get this fixed in Q2 SP1. We are expecting a SP2 release in a couple of weeks and we will try to address this problem there.
Sorry for the delay in getting this addressed.
Kind regards,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Unfortunately, we did not manage to get this fixed in Q2 SP1. We are expecting a SP2 release in a couple of weeks and we will try to address this problem there.
Sorry for the delay in getting this addressed.
Kind regards,
Nikolay
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Kevin Meyer
Top achievements
Rank 1
answered on 02 Sep 2008, 03:19 PM
With Q2 2008 SP1, the following seems to work as long as I do not BeginInit/EndInit around messing with the grid:
gridView.CurrentItem = newDataBoundItem;
... // removed code to get new row bound to item
newRow.IsCurrent = true;
gridView.Columns["MyColumn"].IsCurrent = true;
gridView.BeginEdit();
However, when the grid scrolls to the selected item, it makes it the first item in the list, even if their aren't enough items to make it necessary to scroll. For example, I have a grid with only 1 item in it. I programmatically add a row to the binding source when a button is clicked. I execute the code above to auto-select the new row and put the first cell into edit mode. The grid scrolls to make the new row the first in the visible area, making it seem like we lost the other rows. They are there if you manually scroll back up, but it's confusing. Basically, users wouldn't expect it to scroll if no scrolling is necessary (the row is already in view).
Can we get a fix to the quirky scrolling to the next release? Also, do you know of a current workaround?
gridView.CurrentItem = newDataBoundItem;
... // removed code to get new row bound to item
newRow.IsCurrent = true;
gridView.Columns["MyColumn"].IsCurrent = true;
gridView.BeginEdit();
However, when the grid scrolls to the selected item, it makes it the first item in the list, even if their aren't enough items to make it necessary to scroll. For example, I have a grid with only 1 item in it. I programmatically add a row to the binding source when a button is clicked. I execute the code above to auto-select the new row and put the first cell into edit mode. The grid scrolls to make the new row the first in the visible area, making it seem like we lost the other rows. They are there if you manually scroll back up, but it's confusing. Basically, users wouldn't expect it to scroll if no scrolling is necessary (the row is already in view).
Can we get a fix to the quirky scrolling to the next release? Also, do you know of a current workaround?
0
Hi Kevin Meyer,
I am glad that the issue with the BeginEdit has been solved. We will address all issues related with this method in our upcoming release.
Unfortunately, I wasn't able to reproduce the scrolling issue. I am not sure if I understand correctly the case. Could you, please send me a sample application that reproduces the issue? You can do so in a support ticket.
Thank you in advance for your cooperation.
Greetings,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I am glad that the issue with the BeginEdit has been solved. We will address all issues related with this method in our upcoming release.
Unfortunately, I wasn't able to reproduce the scrolling issue. I am not sure if I understand correctly the case. Could you, please send me a sample application that reproduces the issue? You can do so in a support ticket.
Thank you in advance for your cooperation.
Greetings,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Armand
Top achievements
Rank 1
answered on 08 Jan 2009, 03:44 PM
I have the following simple code in my page load event
A new row is added and the cell in row(0)column(0) goes into edit mode. Focus is on the grid but nothing happens when the user starts typing. Only by mouseclicking in the cell starts the cursor blinking and can the user enter data. The cell is however validated when tab is pressed after the form is loaded. Being in a production enviroment the application is intended to be as mouse free as possible.
Thanks
Armand
Private Sub Logdata_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load |
'test if grid is empty, add new row and place in edit mode |
Dim i As Int32 = RadGridView1.Rows.Count |
If i = 0 Then |
RadGridView1.Rows.AddNew() |
Me.RadGridView1.Rows(0).IsCurrent = True |
Me.RadGridView1.Columns(0).IsCurrent = True |
Me.RadGridView1.PerformLayout() |
Me.RadGridView1.BeginEdit() |
RadGridView1.Focus() |
End If |
End Sub |
A new row is added and the cell in row(0)column(0) goes into edit mode. Focus is on the grid but nothing happens when the user starts typing. Only by mouseclicking in the cell starts the cursor blinking and can the user enter data. The cell is however validated when tab is pressed after the form is loaded. Being in a production enviroment the application is intended to be as mouse free as possible.
Thanks
Armand
0
Hi Armand,
Thank you for contacting us.
The call to the BeginEdit method should be made outside the Form.Load event. For example you could override the OnShown method. There is no need to call the PerformLayout method. Consider the code snippet below:
I hope this helps. Do not hesitate to contact us if you need further assistance.
Kind regards,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Thank you for contacting us.
The call to the BeginEdit method should be made outside the Form.Load event. For example you could override the OnShown method. There is no need to call the PerformLayout method. Consider the code snippet below:
Protected Overrides Sub OnShown(ByVal e As System.EventArgs) |
MyBase.OnShown(e) |
RadGridView1.Rows.AddNew() |
Me.RadGridView1.Rows(0).IsCurrent = True |
Me.RadGridView1.Columns(0).IsCurrent = True |
Me.RadGridView1.BeginEdit() |
RadGridView1.Focus() |
End Sub |
I hope this helps. Do not hesitate to contact us if you need further assistance.
Kind regards,
Jack
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0

Kevin Meyer
Top achievements
Rank 1
answered on 10 Jul 2009, 05:42 PM
We've encountered the same problem again with 8.2.0 (Q3 2008 SP1 I believe). Looking at the implementation of GridViewCellInfo.BeginEdit() (which didn't work for me on it's own) I was able to come up with something that works:
The code needed to set focus to a particular editable cell seems to change from release to release, so this solution may not apply to the latest version. I know we shouldn't have to do this, but looking through the telerik source when things don't work helps find workarounds.
Hope this helps someone.
-Kevin
GridView.GridElement.BeginUpdate(); |
cell.RowInfo.IsCurrent = true; |
cell.ColumnInfo.IsCurrent = true; |
GridView.GridElement.EndUpdate(true); // the key for me was to pass true here (GridViewCellInfo.BeginEdit() implementation passes false) |
GridView.BeginEdit(); |
The code needed to set focus to a particular editable cell seems to change from release to release, so this solution may not apply to the latest version. I know we shouldn't have to do this, but looking through the telerik source when things don't work helps find workarounds.
Hope this helps someone.
-Kevin
0

Diederik
Top achievements
Rank 1
answered on 09 Jun 2010, 10:20 AM
Hi Jack,
I have the exact same problem as described in this post (Focus is on the grid but nothing happens when I start typing). I am using version 2010Q1SP2.
You wrote not to use BeginEdit in the OnLoad event of the form.
I am not sure how to achieve this in my specific case. I am using CAB/SCSF in conjunction with the Telerik CAB Enabling Kit. I open a modal Form (ControlledWorkItem) from another ControlledWorkItem. This newly opened form contains a RadGridView with a row that I want to make editable. I am currently using the OnViewReady event on the presenter which apparently is called during the OnLoad from the form...
Any help would be appreciated.
I have the exact same problem as described in this post (Focus is on the grid but nothing happens when I start typing). I am using version 2010Q1SP2.
You wrote not to use BeginEdit in the OnLoad event of the form.
I am not sure how to achieve this in my specific case. I am using CAB/SCSF in conjunction with the Telerik CAB Enabling Kit. I open a modal Form (ControlledWorkItem) from another ControlledWorkItem. This newly opened form contains a RadGridView with a row that I want to make editable. I am currently using the OnViewReady event on the presenter which apparently is called during the OnLoad from the form...
Any help would be appreciated.
0

Diederik
Top achievements
Rank 1
answered on 09 Jun 2010, 01:44 PM
I Found a workaround for the CAB/SCSF Scenario:
On Control (the view implementation) there is a ParentForm property that returns the form on which the control resides. Subscribing to the Shown Event (as suggested by Jack) solves the problem.
Thanks anyway!
On Control (the view implementation) there is a ParentForm property that returns the form on which the control resides. Subscribing to the Shown Event (as suggested by Jack) solves the problem.
Thanks anyway!
0
Hello Diederik, I am glad to hear that you have found a solution for this issue. If there is something more that I can do, please write back.
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Regards,
Jackthe Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.