Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Grids
Message
 
À
15/10/2002 09:58:16
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00711290
Message ID:
00711323
Vues:
8
The EditCommand is typically used to edit the information in the DataGrid itself. You set the EditItemIndex property to the ItemIndex of the row selected like the following:
dgContacts.EditItemIndex = objArgs.Item.ItemIndex
In your case where you want to navigate to another page, why don't you use the OnSelectedIndexChanged property to set the method to call. ASP.NET will then have the correct setting for the SelectedIndex property.

>Hello,
>
>I have a datagrid on a search screen that is populated from a dataset. In the first column I have an edit button. When I click the edit button I want the browser to navigate to a different page, I know how to do this. The problem I am having is getting the selectedIndex property to not = -1. I'm not sure why this is happening, it has worked for me before. The code for the datagrid's edit_command. Any suggestions would be great.
>
>Here's the code:
>Private Sub dgContacts_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgContacts.EditCommand
> Me.setMessage(Me.dgContacts.SelectedIndex.ToString)
> End Sub
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform