That type of column is rendered as HyperLink control. To manipulate what is show in the row do implement the DataGrid's ItemDataBound event. Here is the small example:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ||
e.Item.ItemType == ListItemType.AlternatingItem)
{
// data item represented by the DataGridItem object
DataRowView drv = e.Item.DataItem as DataRowView;
if (drv == null) return;
// drv.Row represents the ROW
// read value from "WebsiteID" column (type of int)
int i = (int) drv.Row\["WebsiteID"\];
// calculate something...
bool b = (i % 2) == 1;
// get HyperLink column object
HyperLink hl = e.Item.Cells\[0\].Controls\[0\] as HyperLink;
// set NavigateUrl
if (!b) hl.NavigateUrl = "";
}
}
In this example, the first DataGrid's column (index = 0) is a HyperLink column (accessor: e.Item.Cells[0]). That type of column has only one controls in the colection, type of HyperLink.
There is a good example in MSDN, see "DataGridItemEventArgs class, about DataGridItemEventArgs class" topic. -- Mariusz 'mAv' Wójcik master e-software engineer (BPC)