Thursday, March 22, 2012

Do drag and drop controls create DataSets

When I drag a GridView from the toolbox onto a Webform, and then configure its DataSource is a true DataSet created that I can access in the code behind? When my results return I want to be able to access individual rows and cells, taking their values, assiging them to variables and then using the newly equated variable to perform calculations.

Thank you,

Your GridView is bound to dataset It is simple to access values in dataset: your_DataTable.Rows[rowindex][colunmindex]

Or use GridView1.Rows[rowid].Cells[cellindex] to access the control (or findControl(id) if there are many).

No comments:

Post a Comment