Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get GridView Row from contained control
Message
De
07/10/2010 12:35:15
 
 
À
06/10/2010 10:40:48
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01484153
Message ID:
01484343
Vues:
24
>Hi,
>
>I have a GridView on a web page. I am trying to allow the user to change all rows without having to explicitly click an Edit and Update button. One of the columns contains a combobox. When the value in the combobox changes I need to change some values in other columns on the same row. So in my cboReceiptType_TextChanged method, how do I refer to the grid's current row? At this point in time the Grid's EditIndex is -1 (because I'm not using it).

I found the answer:
        protected void cboReceiptType_TextChanged(object sender, EventArgs e)
        {
            DropDownList thisDropDownList = (DropDownList)sender;
            GridViewRow thisGridViewRow = (GridViewRow)thisDropDownList.Parent.Parent;
            int row = thisGridViewRow.RowIndex;
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform