Get drop down selection from GridView on button press

Posted by Chris Stewart on Stack Overflow See other posts from Stack Overflow or by Chris Stewart
Published on 2010-05-21T20:47:55Z Indexed on 2010/05/21 20:50 UTC
Read the original article Hit count: 134

I have an ASP.NET GridView that has four columns. The first three are typical BoundField elements bound to a DataTable. The forth is a TemplateField element that I create a DropDownList in on the OnRowCreated event for the GridView.

What I'm attempting to do is walk down the data source for the GridView when a button is pressed. I really just need to get the values for columns one and four of each row. The first three columns have data as expected but the forth is displaying as empty. Is this because it wasn't a part of the DataTable originally? Is there any way to get the value for each drop down as I've described it, or will I need to rework this so each drop down list is a part of the DataTable?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about gridview