ASP.NET - passing the value from gridview to code behind

Asked By Anjali agarwal on 11-Apr-13 04:51 AM

Hi All,

  I have a gridview that has around 4000 rows, Inside the gridview I have a linkbutton. Once the user clicks the link button, I want one value to be passed to the code behind and also I want to change the background color of the whole row to yellow. If the user clicks on another link button in the gridview, I want the row that he just clicked to be yellow and the old row to be the original color.

Col1   Col2

SELECT   Test1

 SELECT    Test2

so whenever the user clicks on col1 select link button, I want teh ID to be passed to coe behind and the whole row to be turned yellow and if the user chooses to click on second row then I want the first row to be origonal color and the second row to be of yellow color.




Thanks.
Danasegarane Arunachalam replied to Anjali agarwal on 12-Apr-13 10:17 PM
For passing the gridview values to page handled the gridview row_command event as explained here : http://csharp-guide.blogspot.in/2012/05/gridview-commandargument-passing.html. And the row highlighted is posted in your another thread