This is a migrated thread and some comments may be shown as answers.
Why does this code add a blank row between each row with data?
4 Answers 25 Views
This is a migrated thread and some comments may be shown as answers.
keymmachine
Top achievements
Rank 1
keymmachine asked on 10 May 2010, 05:08 PM
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"  
            DataSourceID="AccessDataSource1" DataKeyNames="ID" 
             AllowSorting="True" Skin="" GroupingEnabled="False">             
        <MasterTableView DataSourceID="AccessDataSource1" CssClass="data2" > 
            <NoRecordsTemplate> 
               There are no items available. 
            </NoRecordsTemplate> 
            <ItemTemplate> 
                   <tr> 
                        <td> 
                            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' /> 
                        </td> 
                        <td> 
                            <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Eval("FirstName") %>' /> 
                        </td> 
                        <td> 
                            <asp:Label ID="LastNameLabel" runat="server" Text='<%# Eval("LastName") %>' /> 
                        </td> 
                        <td> 
                            <asp:Label ID="CompanyLabel" runat="server" Text='<%# Eval("Company") %>' /> 
                        </td> 
                   </tr> 
                </ItemTemplate> 
             
                <PagerStyle /> 
 
        </MasterTableView> 
        </telerik:RadGrid> 

4 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 11 May 2010, 02:49 PM
Hi Andrew Keym,

The ItemTemplate should have a wrapper <table> tag. The current configuration leads to invalid XHTML markup on the page.

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
keymmachine
Top achievements
Rank 1
answered on 11 May 2010, 04:29 PM
When I add a table tag it looks worse.  See attachment.  Any ideas?
0
Accepted
Dimo
Telerik team
answered on 11 May 2010, 04:45 PM
Hi again,

First, the <table> needs a 100% width, as tables normally do not expand. Also, if you want to align data cells with header cells, the table should have a table-layout:fixed style applied. Finally, if you don't want the template <table> cells to inherit border styles from the RadGrid skin (which is normal), you should apply explicit styles to remove the borders, for example, add a CSS class to the <table> and then use

div.RadGrid  table.MyTableClass  td
{
       border: 0;
}


All the best,
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
keymmachine
Top achievements
Rank 1
answered on 11 May 2010, 04:58 PM
Gotcha...  Thanks.
Tags
Grid
Asked by
keymmachine
Top achievements
Rank 1
Answers by
Dimo
Telerik team
keymmachine
Top achievements
Rank 1
Share this question
or