The requiremnet is to get the values of the hidden fields values in the gridview
Define the Datakey array in the gridview as follows:
DataKeyNames="EmpID,EmpName,Grade,Servicedate,PositionDescription,DeptFullDesc,EmpType"
Now how to access the DataKey Array for the selected row in code beind. The blow mentioned code populate the label controls.
DataKey dRow = grdReportingEmployee.DataKeys[grdReportingEmployee.SelectedRow.DataItemIndex];
lblEmployeeNumber.Text = dRow[0].ToString();
lblEmployeeName.Text = dRow[1].ToString();
lblGrade.Text = dRow[2].ToString();
lblHireDate.Text = dRow[3].ToString();
lblJobTitle.Text = dRow[4].ToString();
lblDepartment.Text = dRow[5].ToString();
The blog is created to discuss Prince2 methodology any issues faced in project management to be resolved or discussed and .Net Technology
Sunday, August 17, 2008
Monday, July 28, 2008
Welcome Note
This blog will be the source of tips and tricks for ASP.Net learners and other events relating to IT.
Subscribe to:
Posts (Atom)