locked
Register custom type/model RRS feed

  • Question

  • User-484343887 posted

    The vanilla dynamic data screen looks ok but I am trying to do some custom things, like presetting the filter dropdowns, reorder the dropdown position and so on.

    I have removed the linqdatasource and created my own type class (MyCustomType). In my custom LINQ query I *select new* into my custom type. Some of the cutom type properties are foreing keys to the main table I am querying.

    In the markup I created a new gridview and declared my own columns. I added a couple of *dynamiccontrol* fields, but I am getting an error now. "MyCustomType is not a registered model". I am trying to register it in my global.asax, but no luck.

    Any advice on how to get this scenario to work?

    thanks

    --tolga

    Thursday, November 20, 2008 1:52 PM

All replies

  • User-330204900 posted

    You will have to have a look at the Dynamic Data Futures project here wich has a sample for you own classes here Source Code DynamicDataFutures0716.zip, however in the future there will be a new data source see here ASP.NET Dynamic Data 4.0 Preview 1 which has a BusinessLogicDataSource (not working with DD yet [:(])

    Hope this helps [:D]

    Thursday, November 20, 2008 3:00 PM
  • User-1005219520 posted

    The vanilla dynamic data screen looks ok but I am trying to do some custom things, like presetting the filter dropdowns, reorder the dropdown position and so on. I have removed the linqdatasource and created my own type class (MyCustomType).

    You don't need a custom type to reorder, preset dropdown, etc. Generally speaking Dynamic Data does not support arbitrary types, it supports the Entity Data Model (via System.Data.Objects.ObjectContext) and the L2S System.Data.Linq.DataContext

     BTW, the next version of Dynamic Data will have much more flexibility in filters (including ordering, adding new filters, etc)

    Thursday, November 20, 2008 3:58 PM
  • User-1005219520 posted

    deleting dup

    Thursday, November 20, 2008 3:58 PM