So. I saw the post about adding a hypertext link to a cell and that it will be added in future versions. I'm trying to find a workaround for this for time being.
I have tried to use the GridViewCommandColumn type, but I don't want the cell to look like a button. I can't find where I can change that either using a style builder or just by getting to the appropriate style properties of the cell or column.
I almost have exactly what I want by adding a mouse enter, leave and click event to the CellElement. The problem that I have is that the only time that I can find to get the CellElement object is during the CellFormatting event. Unfortunately, by changing the Font (to underline or not on MouseEnter and MouseLeave) is causing the CellFormatting event to fire which causes me to add handlers again.
private void grid_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.HeaderText == "MYField")
{
e.CellElement.Click += new EventHandler(MYField_Click);
e.CellElement.MouseEnter += new EventHandler(MYField_MouseEnter);
e.CellElement.MouseLeave += new EventHandler(MYField_MouseLeave);
}
}
Any thoughts on where, other than the CellFormatting event I can get a handle the actual CellElements?
I have tried to use the GridViewCommandColumn type, but I don't want the cell to look like a button. I can't find where I can change that either using a style builder or just by getting to the appropriate style properties of the cell or column.
I almost have exactly what I want by adding a mouse enter, leave and click event to the CellElement. The problem that I have is that the only time that I can find to get the CellElement object is during the CellFormatting event. Unfortunately, by changing the Font (to underline or not on MouseEnter and MouseLeave) is causing the CellFormatting event to fire which causes me to add handlers again.
private void grid_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.HeaderText == "MYField")
{
e.CellElement.Click += new EventHandler(MYField_Click);
e.CellElement.MouseEnter += new EventHandler(MYField_MouseEnter);
e.CellElement.MouseLeave += new EventHandler(MYField_MouseLeave);
}
}
Any thoughts on where, other than the CellFormatting event I can get a handle the actual CellElements?