This is a migrated thread and some comments may be shown as answers.

Strange behaviour hover + select style template column

2 Answers 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc Schaaks
Top achievements
Rank 1
Marc Schaaks asked on 27 May 2010, 10:04 AM

I have a template column that performs odd when selecting and hovering the row:

When hovering (and selecting), the column shows a solid bottom line (see pic1).

Moreover, the hover style only works for the other columns and on certain parts in the template column.

This is how the code in the template column looks like:

 

 

<telerik:GridTemplateColumn HeaderText="Document" UniqueName="TemplateColumn"

 

 

DataField="DocumentName" Aggregate="Count" FooterText="Number of documents found: "

 

 

SortExpression="DocumentName" ItemStyle-Wrap="false">

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<table style="width:100%;">

 

 

 

 

 

<tr>

 

 

 

 

 

<td nowrap="nowrap">

 

 

 

 

 

<asp:Image ID="Image1" runat="server" AlternateText='<%# Eval("ClassName") %>'

 

 

ImageUrl='<%# Eval("TypeIconUrl") %>' ToolTip='<%# Eval("ClassName") %>' />

 

 

 

 

 

<asp:Image ID="Image2" runat="server" AlternateText='<%# Eval("StateText") %>'

 

 

ImageUrl='<%# Eval("StateIconUrl") %>' ToolTip='<%# Eval("StateText") %>' />

 

 

<asp:Label ID="Label1" runat="server" Text='<%# Eval("DocumentName") %>'></asp:Label>

 

 

 

 

 

</td>

 

 

 

 

 

</tr>

 

 

 

 

 

</table>

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 
Any ideas how to solve this ?

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 May 2010, 12:09 PM
Hello Marc,

Both problems are caused by the presence of a <table> element inside the ItemTemplate.

1. The table cells inside the template inherit border styles from the RadGrid skin, which is normal. You can avoid this by using the following CSS rule:

.RadGrid  .rgRow  td  td,
.RadGrid  .rgAltRow  td  td
{
        border-width: 0 ;
        padding: 0 ;  /* will remove the RadGrid skin cell paddings */
}


2. Due to performance considerations, the row hover styles do not work when you mouseover a <table> inside a template column.


I suggest you to remove the <table> from the ItemTemplate - it seems it is not needed anyway.


Regards,
Dimo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Marc Schaaks
Top achievements
Rank 1
answered on 31 May 2010, 01:21 PM
Dimo,

Indeed the removal of the table elements did the trick.

Thanks for your quick reply on this !

Marc.
Tags
Grid
Asked by
Marc Schaaks
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Marc Schaaks
Top achievements
Rank 1
Share this question
or