[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


ASP.net populate extra column in GridView through button click

Posted on 2011-10-22
Medium Priority
Last Modified: 2012-05-12

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
                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

Question by:Murray Brown
LVL 96

Accepted Solution

Bob Learned earned 2000 total points
ID: 37012754
If you are doing something dynamically, that is not stored in the view state, then you need to recreate that when you post back the page.

Author Closing Comment

by:Murray Brown
ID: 37013178
Thanks very much

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question