Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Databinding and the TemplateField Element.
 

Databinding and the TemplateField Element.

 

Hi,

I'm a new boy to website design in general and VWD in particular. I'm following an exercise (6-2) in a book called 'Beginning VWD Express 2005, by Paul Sarknas.

Anyway, I created a blank project, then added and succesfully configured a sqldatasource control. Then I dropped a Gridview and connected it to the data source. Everything works well, I can see the data displayed as it should be when I build the page. Fine.

Then the excercise requires me to insert the following code in order to bind the data -

<asp:TemplateField HeaderText="UnitPrice">

<ItemTemplate>

<asp:Label ID="labelPrice" runat="server"

Text='<%#Eval( "UnitPrice" )%>'></asp:Label>

</ItemTemplate>

</asp:TemplateField>

When I begin typing the <asp, the little drop down menu offers me all the possible elements, but TemplateField isn't one of them. When I've finished typing there is a squiggly line (sorry for the 'tech' speak) under TemplateField, ItemTemplate, and asp:Label. When I build and view the page there is no difference.

Why isn't TemplateView available on the dropdown list, and why isn't it recognised as an element/class? And do I really need to learn databinding to design commercial websites?

Thanks for your help in anticipation.

Michael

 

Michael1965  Friday, July 28, 2006 1:39 PM
Please try posting this in one of the asp.net forums. This forum is for windows forms questions.
Ken Tucker  Saturday, July 29, 2006 11:30 AM
Please try posting this in one of the asp.net forums. This forum is for windows forms questions.
Ken Tucker  Saturday, July 29, 2006 11:30 AM

You can use google to search for other answers

Custom Search

More Threads

• Delete rows from one table based on condition on another table
• Treeview children
• DataGridView Custom column - To show tabular data in a column
• Refresh databound Combobox
• row errortext doesn't appear
• Can I save the positions and other details on closing a form and later use this very information to layout the components the next time?
• Columm in SQL
• Linking BindingSource components?
• Grid is not sortable
• bindingsource list Contains(me.formattedvalue) always is false.