Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

ASP.net populate extra column in GridView through button click

Hi.

I have a GridView on my ASP.net site that has an extra column containing buttons
and another containing labels. When I click the button in one row I have managed to populate the label column with text. The only problem is that when I click the next row it clears the label populated in the other one. I need to stop this from happening
Private Sub GridView2_RowCommand1(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView2.RowCommand
        Try
                Dim index As Integer = Convert.ToInt32(e.CommandArgument)
                ' Retrieve the row that contains the button 
                ' from the Rows collection.
                Dim row As GridViewRow = GridView2.Rows(index)
                row.Cells(0).Text = "Strongly Agree"

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks very much