Hi,
If the value of property, which is defined in DataTextField property of the GridHyperLinkColumn, is empty or null, then the grid cell is rendered in a way like this:
<td><a href="MyPage.aspx?MyItemId=5"></a></td>
This cause problems in IE, because there is no border of such a cell there.
All I can do is to use ItemDataBound handler to redefine rendering rules:
protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = e.Item as GridDataItem;
MyObject myObject = item.DataItem as MyObject;
TableCell cell;
if (string.IsNullOrEmpty(myObject.MyProperty))
{
cell = item["MyProperty"];
cell.Controls.Clear();
cell.Controls.Add(new LiteralControl(" "));
}
}
}
After that my cell is rendered in this way:
<td> </td>
And after that, that's OK with IE :)
Is it possible not to perform this routine?
If the value of property, which is defined in DataTextField property of the GridHyperLinkColumn, is empty or null, then the grid cell is rendered in a way like this:
<td><a href="MyPage.aspx?MyItemId=5"></a></td>
This cause problems in IE, because there is no border of such a cell there.
All I can do is to use ItemDataBound handler to redefine rendering rules:
protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = e.Item as GridDataItem;
MyObject myObject = item.DataItem as MyObject;
TableCell cell;
if (string.IsNullOrEmpty(myObject.MyProperty))
{
cell = item["MyProperty"];
cell.Controls.Clear();
cell.Controls.Add(new LiteralControl(" "));
}
}
}
After that my cell is rendered in this way:
<td> </td>
And after that, that's OK with IE :)
Is it possible not to perform this routine?