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

GridLines disappear when using Template column

2 Answers 30 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Newbery
Top achievements
Rank 1
Steve Newbery asked on 21 Aug 2008, 11:56 AM

When a radGrid column is a non-templated regular column, and the database field is empty, I see the gridlines ok, eg using skin Outlook2007:

<telerik:GridBoundColumn DataField="FileName" HeaderText="FileName"   
    SortExpression="FileName" UniqueName="FileName">  
</telerik:GridBoundColumn> 

But, when I convert the column to a template column, and the field is empty or it contains only spaces, the gridlines disappear for that cell:

<telerik:GridTemplateColumn DataField="FileName" HeaderText="FileName"   
    SortExpression="FileName" UniqueName="FileName">  
    <EditItemTemplate> 
        <asp:TextBox ID="FileNameTextBox" runat="server"   
            Text='<%# Bind("FileName") %>'"></asp:TextBox> 
    </EditItemTemplate> 
    <ItemTemplate> 
        <asp:Label ID="FileNameLabel" runat="server"   
            Text='<%# Eval("FileName") %>'></asp:Label> 
    </ItemTemplate> 
</telerik:GridTemplateColumn> 
 

Why is this? And how can I work around this problem?

Thanks, Steve

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 21 Aug 2008, 12:10 PM
Hello Steve,

Add a  &nbsp;  at the and of the ItemTemplate.


Kind regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve Newbery
Top achievements
Rank 1
answered on 21 Aug 2008, 01:24 PM
Aha yes! That's fixed it - many thanks Dimo
Tags
Grid
Asked by
Steve Newbery
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Steve Newbery
Top achievements
Rank 1
Share this question
or