Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data not showing in datagrid? 1

Status
Not open for further replies.

suicidaltendencies

Programmer
Jan 28, 2004
58
US
The data show on the datagrid if I remove the asp:label from around the DataBinder but if I include the asp:label my data disappears.

What is wrong?

Thanks,
Harold

<asp:templatecolumn headertext=&quot;Date&quot; itemstyle-verticalalign=&quot;top&quot; headerstyle-horizontalalign=&quot;center&quot;>
<itemtemplate>
<asp:label id=&quot;lblDate&quot; runat=&quot;server&quot;><%# DataBinder.Eval(Container.DataItem, &quot;Date&quot;, &quot;{0:MM/dd/yyyy}&quot;) %></asp:label>
</itemtemplate>
</asp:templatecolumn>
<asp:templatecolumn itemstyle-verticalalign=&quot;top&quot; headertext=&quot;Customer Name&quot; headerstyle-horizontalalign=&quot;center&quot;>
<itemtemplate>
<asp:label id=&quot;lblName&quot; runat=&quot;server&quot;><%# DataBinder.Eval(Container.DataItem, &quot;Name&quot;) %></asp:label>
</itemtemplate>
</asp:templatecolumn>
 
I think you need to set the text property of the label rather than put it between the label tags i.e.

Code:
<asp:label id=&quot;lblName&quot; runat=&quot;server text='&quot;><%# DataBinder.Eval(Container.DataItem, &quot;Name&quot;) %>'></asp:label>

james :-)

James Culshaw
james@miniaturereview.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top