Re: GridView LINQ double foreign key

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello Chunk

You may have noticed that Scott Gu's blog uses "Eval", a one-way
databinding keyword, to bind the 2-level property "Supplier.CompanyName".
It's not using the keyword "Bind". "Bind" supports two-way databinding,
i.e, both selecting and updating the data, however, it suffers from the
defects that it cannot bind mult-level properties. That's to say, if we
modify Scott's blog to use "Bind":

<asp:TemplateField HeaderText="Supplier"
SortExpression="Supplier.ComparyName">
<ItemTemplate>
<asp:Label runat="server" ID="lbl" Text='<%#
Bind("Supplier.CompanyName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

It will also throw the error "A call to Bind was not well formatted.
Please¡­" in the compilation time.

In order to work-around this problem and do "update" operations on the
Category column, Scott uses an additional dropdownlist "CategoryList" to
bind to the data source "CategoryDataSource". In this way, the "Text" shown
in UI is the readable category name, but the real value bound to the column
will still be the category ID, i.e. the one-level property.

All in all, "Eval" supports mult-level property, but does not support the
operation of "update", whereas, "Bind" supports "update", but it suffers
from one-level property binding. Therefore, Chunk, you may consider Scott's
workaround in his blog entry, or my two in the last reply. Is this
explanation helping you have a clearer picture about how "Bind" and "Eval"
work in databinding?

Thanks
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

.



Relevant Pages

  • Correction: 9.3.0rc4 [Re: HEADS UP! BIND 9.2.3 coming soon!]
    ... Scott Long wrote: ... > I wanted to give everyone fair warning that BIND 9.2.3 will be replacing ... If you are running production BIND servers then you might want ...
    (freebsd-current)
  • Re: radomize a number list
    ... Here is a version that selects first element randomly, then puts rest in ... order (same way Bind does round robin.) I needed another ArrayList for ... "Scott" wrote in message ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: MVC Framework - Routing
    ... I have detailed the wiring of MVC on my blog. ... Check Scott Guthrie's ... RouteTable.Routes.Add(new Route ...
    (microsoft.public.dotnet.framework)
  • Re: RIP Bob Hoover
    ... Scott wrote: ... this to his BLOG. ... I exchanged e-mails several time's with him with ... question's and always came away with a more complete understanding of ...
    (rec.aviation.homebuilt)
  • Re: [MSH] Monad Covered in this Weeks Hanselminutes Podcast
    ... Not too long ago Scott posted a blog entry on ... you could use MSH to do this even more easily. ... Anyway that got Scott ... I sure hope that the Monad was wanting wider exposure for MSH because it is ...
    (microsoft.public.windows.server.scripting)