Hi stormage,
The GridView uses Bind as well, but by default handles this internally. To see what I mean, take the code example from the bottom of page 440 (the GridView) and place it in an ASP.NET page. You can see that the columns exist of BoundFields. For example, the Name field looks like this:
Code:
<asp:BoundField DataField=âNameâ HeaderText=âNameâ SortExpression=âNameâ />
The BoundField acts as a wrapper around the various templates (such as the item, insert and edit templates). Additionally, this control is able to keep track of the column it's associated with without explicit Bind syntax.
Next switch the page into Design View, open the GridView's Smart Tasks panel and choose Edit Columns. In the Selected Fields drop down, click Name and then click the blue Convert This Field Into A TemplateField link. You won't see a difference in Design View. Next, switch back to Markup View and look at the code for the Name field:
Code:
<asp:TemplateField HeaderText="Name" SortExpression="Name">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Notice how it now uses Bind to hook up the various columns to their respective controls.
So, the GridView uses a binding concept as well; it's just that by default it hides this from you using BoundField controls if you have no need to alter the appearance of the columns (which you can do once you've converted them to templates).
Does this help?
Imar