0
Sushila D. Patel -
the answer to my question was one of mixing data types. I got lost in the maze of DataColumnCollections & DataGridColumnCollection. I was also mixing in DataTable columns and getting my underwear in a bunch. Here is the answer to the problem:
private void dgContactHistory_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
string strID;
DataGridColumnCollection dc;
dc = dgContactHistory.Columns;
foreach(DataGridColumn dcCol in dc)
{
if ((e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Item))
{
strID = e.Item.Cells[0].Text;
e.Item.Cells[dc.IndexOf(dcCol)].Attributes.Add("onmouseover",
"this.style.backgroundColor='White';this.style.cursor='hand';"
+ "window.status='Comment=" + strID + "'");
e.Item.Cells[dc.IndexOf(dcCol)].Attributes.Add("onmouseout",
"this.style.backgroundColor='';this.style.cursor='default';"
+ "window.status=''");
e.Item.Cells[dc.IndexOf(dcCol)].Attributes.Add("onclick",
"javascript:window.open('MessageWindow.aspx?id=" + strID + "',"
+ "'CommentDetails','height=300,width=330')");
};//end of if...
};//end of foreach
}//end of function
