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

Template Columns not displayed

2 Answers 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
hamda
Top achievements
Rank 1
hamda asked on 16 Jun 2010, 05:49 AM
Hi all,

I have a radgrid with two template columns i use to show the data instead of database ids, but when i run it ,it only shows the headers of the template columns not the data. What could be the reason?

Regards,
Hamda

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Jun 2010, 07:29 AM
Hello Hamda ,

Have you bind the controls inside the template? You must use a data binding expression on the appropriate control property. The following example shows how use GridTemplateColumn and how to bind the controls inside the column:

aspx:
 
<telerik:GridTemplateColumn HeaderText="CustomerID" UniqueName="TemplateColumn"
    <ItemTemplate> 
        <asp:Label ID="Label1" runat="server" Text='<%# Eval("CustomerID") %>'></asp:Label> 
    </ItemTemplate> 
    <EditItemTemplate> 
        <asp:TextBox ID="TextBox1" ToolTip='<%# Eval("CustomerID") %>' Text='<%# Bind("CustomerID") %>' 
            runat="server"></asp:TextBox> 
    </EditItemTemplate> 
</telerik:GridTemplateColumn> 

Could you provide the code that you tried, if this does not help?

-Shinu.
0
HL
Top achievements
Rank 1
answered on 08 Apr 2011, 06:52 PM
never mind. I figure out the reason. need to change to use RadGrid item type to check instead of normal grid
Tags
General Discussions
Asked by
hamda
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
HL
Top achievements
Rank 1
Share this question
or