Programming, technology, and CRM – from a Belgian programmer exiled to Missouri
  • rss
  • Home
  • Soft Gallery
    • autosvnbackup.sh
    • VBScript Snippets
  • Contact Me
  • Welcome

ASP.NET DataBinding Take 2 (or is it 3)

Nicolas Galler | November 20, 2007

Well I finally bit the bullet and implemented the solution I discussed in my previous post on databinding by creating a new data source control. 2 comments:

  1. It was ridiculously easy
  2. It is fucking awesome

So now the code from my datagrid looks like this:

<asp:gridview datasourceid='dsProducts'>
<columns>
<DataBoundField DataField='ProductName'>
</columns>
</asp:gridview>

<sss:SlxEntityDataSource EntitySourceProperty='Products' id='dsProducts' >

The SlxEntityDataSource retrieves the entity bound to the page and resolves the Products property. That’s pretty much it really… There is an EntityDataSourceView which contains the actual logic needed to retrieve the entity within the collection… It is also possible to just set this to a custom collection. And of course NHibernate automatically persists all this mess (with the help of Saleslogix to save it into the session until we are ready to commit it) without me having to lift one finger. Next in line is adding a small improvement to the GridView to make it possible to edit more than 1 row at a time because having to click Edit/Update every time is a bit of a drag. There is a good post for this on Matt Dotson’s blog.

Well the last comment I can make for now is what a piece of dogshit ObjectDataSource is. I wish I hadn’t spent so much time trying to make it work despite all. The ASP.NET databinding is actually starting to look pretty good!

Categories
Programming
Comments rss
Comments rss
Trackback
Trackback

« VS2008 Download Sucks Slx 72 Web Windows Authentication Explained »

Leave a Reply

Click here to cancel reply.

Categories

  • Experiments (4)
  • Interesting (1)
  • MSCRM (1)
  • Programming (60)
  • Rant (3)
  • Saleslogix (34)
  • Tricks (8)
  • Uncategorized (30)

Post History

  • 2010
    • January (3)
    • March (3)
    • April (2)
    • August (2)
  • 2009
    • March (2)
    • April (1)
    • May (3)
    • June (3)
    • July (1)
    • September (3)
    • October (2)
    • December (5)
  • 2008
    • January (9)
    • February (4)
    • March (9)
    • April (1)
    • May (5)
    • June (8)
    • July (1)
    • August (2)
    • September (1)
    • November (1)
    • December (3)
  • 2007
    • January (3)
    • February (7)
    • March (1)
    • April (3)
    • May (6)
    • June (2)
    • July (1)
    • August (2)
    • September (5)
    • October (3)
    • November (5)
    • December (4)
  • 2006
    • January (2)
    • September (1)
    • November (3)
    • December (4)
  • 2005
    • April (1)

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox