for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string empCode = ds.Tables[0].Rows[i]["EMP_CODE"].ToString();
string empName = ds.Tables[0].Rows[i]["EMP_NAME"].ToString();
string gradeCode = ds.Tables[0].Rows[i]["GRADE_CODE"].ToString();
tr = new TableRow();
td = new TableCell();
td.Text = empCode;
tr.Cells.Add(td);
tableButton.BackColor = System.Drawing.Color.Transparent;
tableButton.Text = empCode;
td = new TableCell();
td.Text = empName;
tr.Cells.Add(td);
td = new TableCell();
td.Text = gradeCode;
tr.Cells.Add(td);
table1.Rows.Add(tr);
}
This is the code I am working on.
As I create each cell in the table, I want to add a click event to the cell. What steps should I take to achieve this? Please advise.