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

Programmatically put cell into edit mode

7 Answers 1067 Views
GridView
This is a migrated thread and some comments may be shown as answers.
joseph_korn
Top achievements
Rank 1
joseph_korn asked on 18 May 2008, 10:18 PM
In the Q3 2007 version, I was able to put a radgridcell into edit mode by doing this:

this.radGridView1.Rows[2].IsCurrent = true;  
this.radGridView1.Columns[2].IsCurrent = true;  
((GridDataCellElement)this.radGridView1.CurrentCell).BeginEdit();  

But now in the Q1 2008 version, the method BeginEdit() no longer belongs to the GridDataCellElement class..

1) How can I accomplish this in the 2008 version
2) Is there somewhere on this site, or maybe in the documentation provided with the controls themselves where I might be able to find the answer to this question, and similar questions, without having to ask about it here?

7 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 May 2008, 01:39 PM
Hi joseph_korn,

In Q1 2008 your code should be altered as it follows:
 
this.radGridView1.Rows[2].IsCurrent = true;  
this.radGridView1.Columns[2].IsCurrent = true;  
this.radGridView1.BeginEdit(); 
 
As to release documentation, we publish full release notes with every product version which comes out. For Q1 2008 we introduced several breaking changes which are duely noted in red color in the release notes. As far as RadGridView goes, we have also provided an extensive PDF file which will help you to swiftly move from the old to the new RadGridView version. The PDF can be found in the full release notes --> RadControls for WinForms Q1 2008 --> RadGridView --> Breaking Changes

If you have additional questions, do not hesitate to contact me.

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
joseph_korn
Top achievements
Rank 1
answered on 20 May 2008, 07:12 PM
Hi, thanks for the reply.. I tried the code that you suggested, but it does not seem to work properly.. There are two problems that I notice:

1) I must already be in edit mode on any row before this code will even do anything at all.. I do not know the exact terminology, so I will explain further.. By default when I single-click on a row, the record selector row is showing an arrow icon, but when I double click a cell on a row, it changes to edit mode, and instead of an arrow icon, it is a pencil icon.. If I have the arrow icon displayed (not in edit mode), and I click the button that runs the code to put a particular cell in edit mode, then seemingly nothing happens. Only when the pencil icon is already showing will it focus on the appropriate cell.. This leads me into my next problem..

2) When I can get the focus to the appropriate cell, the particular cell type doesn't behave properly.. I will give an example to illustrate what I mean:

I have 2 cells in my gridview, cell #1 is a dropdown column, and cell #2 is a regular textbox column.. If I click to edit cell #1, then click the button to run the code to put cell #2 into edit mode programmatically, cell #2 does indeed go into edit mode, but it is not a textbox, it is a dropdown, with the same list of values from column #1.. The behavior is flipped when I edit cell #2, click the button that is to put cell #1 into edit mode, cell #1 doesn't display a drop down, instead it lets me type into it like a textbox..

All I am using to accomplish this on button click is the same three lines that are outlined above..

Any suggestions?
0
Nikolay
Telerik team
answered on 22 May 2008, 02:33 PM
Hello joseph_korn,

You are correct. There is an issue when trying to set a cell in edit mode programmatically and your directions helped me reproduce it. Please excuse us for the inconvenience this issue has caused you.

It has been logged and will be addressed in one of our next versions. Unfortunately, I cannot give you a workaround for the time being.

I updated your Telerik points account with 500 points for the report.

Contact me, if you have additional questions.

All the best,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kevin Meyer
Top achievements
Rank 1
answered on 25 Aug 2008, 09:22 PM
Has this been resolved in Q2 2008?  We're currently running Q1 2008 SP1 and I can't seem to get a cell to go to edit mode programmatically.
0
Nikolay
Telerik team
answered on 28 Aug 2008, 04:29 PM
Hello 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.
 

All the best,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Nancy
Top achievements
Rank 1
answered on 25 Feb 2009, 06:02 PM
Should this now be working in Q3 2008 SP1?  
0
Nikolay
Telerik team
answered on 04 Mar 2009, 09:55 AM
Hello Nancy,

Thank you for the question.

Both issues discussed by joseph_korn are addressed in Q3 2008 SP1. If you, however, continue to experience any similar issues, please open a new support ticket and send me a sample project. This will allow me to investigate your specific case further.

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
joseph_korn
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
joseph_korn
Top achievements
Rank 1
Kevin Meyer
Top achievements
Rank 1
Nancy
Top achievements
Rank 1
Share this question
or