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

put first cell in edit mode by code

7 Answers 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Louis
Top achievements
Rank 1
Louis asked on 03 Oct 2007, 01:32 PM
I have a button that add a row in my grid.
when a row is added i need to put the first cell in edit mode with the focus on it.

How to do this?
thanks

7 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 03 Oct 2007, 03:08 PM
Hi Louis ,

Currently, we do not support the feature you've described. However, we will add it to our feature request list for upcoming versions of our product.

Thank you for sharing your idea.

Sincerely yours,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Louis
Top achievements
Rank 1
answered on 03 Oct 2007, 03:45 PM
When is your next release available ?

Your controls are sure great and on a good way but they are missing so much features (basic to me) that our development is compromised right now.

When are you planning to support this behavior?
0
Jack
Telerik team
answered on 04 Oct 2007, 03:58 PM
Hi Louis,

I was reviewing your questions from today when I stumbled on this one. It seems that Jack missed your point because we do have this feature. I will talk to him to see what happened and he replied this way. At any rate, here is the code:

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

Please let me know if that helps.
 

Kind regards,

Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Louis
Top achievements
Rank 1
answered on 05 Oct 2007, 05:31 PM
Hi Rob,

i've tried your code sample but when i create a new line, add it to my bindingsource and after try this out 

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

CurrentCell is null !

what is wrong ?
thanks
0
Jack
Telerik team
answered on 08 Oct 2007, 02:14 PM
Hi Louis ,

Make sure that your binding source implements IBindingList and fires the ListChanged event to notify grid about the newly added row. Also the added row must be visible inside grid to have a visual element. Setting the IsCurrent property does not ensure that the row is visible. To ensure this, call the RadGridView.GridElement.ScrollToRow function.

If this information does not resolve your issue, please open a formal support ticket and send us your application and we will research the casue in detail.

Thanks in advance.

 
Best wishes,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Louis
Top achievements
Rank 1
answered on 11 Oct 2007, 08:18 PM
still not working ??

my datasource is a bindingList. when i add a row i do this

grdSearchResults.Rows[paxList.Count - nb].IsCurrent = true;  
grdSearchResults.Columns[0].IsCurrent = true;  
grdSearchResults.GridElement.ScrollToRow(grdSearchResults.CurrentRow);  
((GridDataCellElement)grdSearchResults.CurrentCell).BeginEdit();  
 

and still CurrentCell is null?

what you mean by "fires the ListChanged event to notify grid about the newly added row." ?

Also how can i do if i dont want the scrollbar to be displayed (i have 2 rows and the grid shift to the bottom with a scrollbar ??!)
0
Jack
Telerik team
answered on 12 Oct 2007, 04:05 PM
Hello Louis ,

We didn't managed to reproduce this issue. We will be glad to help you if you provide a sample application to inspect the issue in detail. If you have any other questions or ideas, don't hesitate to contact us.
 

Greetings,
Jack
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Louis
Top achievements
Rank 1
Answers by
Jack
Telerik team
Louis
Top achievements
Rank 1
Share this question
or