If you are wanting to work with a cell instead of a row, you need to get access to that control of the datagrid.
In the .aspx file:
Code:
<asp:DataGrid …Attributes… OnItemDataBound=”OnItemDataBoundEventHandler”> //This specifies the function to call when populating the grid.
In your .aspx.cs (or .vb) file:
Code:
public void OnItemDataBoundEventHandler(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
TableCell tableCell = (TableCell) e.Item.Controls[0]; //Controls[0] is the first column in your grid.
}
You then can work with the tableCell object to manipulate the specific cell.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.