Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting focus to a grid cell
Message
De
10/02/2009 15:44:48
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01379950
Message ID:
01380679
Vues:
41
Glad you got it working Linda! =0)

~~Bonnie




>>Linda, is this a Web grid or a Windows grid? If you're talking about a Windows DataGridView, then probably all you need to do is set this property:
>>
>>this.EditMode = DataGridViewEditMode.EditOnEnter;
>>
>>~~Bonnie
>>
>>
>>
>>
>>>I have some very small tables in which users enter data directly. I am using buttons to add, delete, etc. When they click on the New button, I would like to put the cursor in the cell of the newly added row. I used grdMyGridControl.Focus(), which hightlights the correct cell but the user still has to click in the cell in order to start entering data. Any ideas? Thanks.
>
>Bonnie,
>It turns out that my original this.grdMyGrid.Focus() works just fine if you actually use the correct control name. It turns out I had a control reference remaining in the designer left from deleting a control from the form. I didn't notice that when I was setting the focus.
>In the process of figuring this out, I also came across another little tidbit. There is a form level function form.SetFocus(this.controlname). However, it does not work if the control is on a tab page. You may already know about this but perhaps it will help someone else. Thanks for your help.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform