locked
DefaultValue attribute with ForeignKey filter RRS feed

  • Question

  • User151714553 posted

    Can someone provide me with an example of using the DefaultValue attribute with a ForeignKey filter? I can't get it to work!

    Cheers, Simon

    Monday, June 27, 2011 1:54 AM

Answers

  • User-330204900 posted

    OK if you have a look at your standard Insert page you will see the line

    FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
    

    this line takes any value spassed into the page via the route and then passes them to the FormView to populate the default values. so all you need to do is add your values to the dictionary.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 27, 2011 12:42 PM

All replies

  • User-330204900 posted

    Hi Simon, what version of DD are you on VS2008 .Net 3.51 SP1 or VS2010 .Net SP1?

    Monday, June 27, 2011 7:28 AM
  • User151714553 posted

    Hi Stephen. I'm using VS2010 sp1, Linq2SQL and .NET4.

    Monday, June 27, 2011 8:15 AM
  • User-330204900 posted

    OK if you have a look at your standard Insert page you will see the line

    FormView1.SetMetaTable(table, table.GetColumnValuesFromRoute(Context));
    

    this line takes any value spassed into the page via the route and then passes them to the FormView to populate the default values. so all you need to do is add your values to the dictionary.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 27, 2011 12:42 PM