.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

.NET 4 changes to MetaTable.GetColumn() or DynamicControl?

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :ASP.Net

I have a fairly complex web form using DynamicData with a bunch of customized FieldTemplates.  Everything worked fine under .NET 3.5 SP1... then I converted to .NET 4.0 and some fields refuse to load giving an error like: 

System.InvalidOperationException: The table 'Tickets' does not have a column named 'Contact'.

The stack trace shows System.Web.DynamicData.MetaTable.GetColumn(String columnName) throwing the actual exception, so thinking something was changed with that function.  No idea what, however... :(

I've verified that the columns are there (I can access using Eval() and such, but DynamicControl won't find the columns.)  To make matters worse, there are several fields for which it DOES work and I can't see anything really different between the columns that do work and the ones that don't.

View Complete Post

More Related Resource Links

Unable to convert type System.String to System.Web.DynamicData.MetaTable



I am encountering the problem  "Unable to convert type System.String to System.Web.DynamicData.MetaTable" when I hit one of the tables for List.aspx.  It is using the DynamicData/PageTemplates/List.aspx and this error is not happening in other tables.

It is happening on the line

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

If you have any leads, please let me know.



Easiest / Best to NOT show DynamicControl if data value is null?


Using Dynamic Data 4.0 , I have a particular case (not of MY design ;>) where the data is very wide and very sparse.  Typically 10 fields contain values out of a possible 260 fields.  For a Detail page (at least) I would prefer not to build the 260 fields, just show the 10.

I am looking at the DynamicControl and it has a Visible property, but not a property like "MakeVisibleIfContainsNullData".  Has anyone thought of a different way to do this?  Thanks!

pass UIHint arguments DynamicControl tag



Is it possible to pass arguments in the UIHint property of a DynamicControl tag?


<asp:DynamicControl datafield="SponsorId" UIHint="Person" runat="server" Mode="Edit"/>





How to get the value from a in a wizard? (custom entity template)


I have a question about the Dynamic Data API... trying to figure out how to get the value the user entered in an <asp:DynamicControl> that's in a different wizard step.

I am using an <asp:Wizard> as the entity template for one of my tables.  This works well so far...I basically hijacked the Finish button of the wizard and make changed CommandName="Update" or CommandName="Insert" instead of the wizard default command, so that the finish command will be treated as the update or insert command of the entity template.  I also added <asp:DynamicControl>'s in the different steps for all of my fields which works nicely because I don't have to have custom code for each field.  This works very well and my records are edited and inserted successfully.

But I'm a bit puzzled about how to make the preview step ... I would need to look up the values that the user entered in the <asp:DynamicControl>'s in the previous steps, and I'm not sure how to do that.  Seems like the process of getting values from those fields is taken care of automatically when I edit or insert records and I'm not sure if there's a way to get the values manually.

Anyway I'll be investigating this today so I'll report back if I find an answer... thanks in advance!

Pre-filtering the MetaTable


I need a device to be able to "pre-filter" tables depending on user roles.

For example, I have an object called "Permissions" that dictates which "company", for example that a user can view data for ..

So user A can only view employees from Company A, User B from Company B etc.

Any ideas?

JavaScript function in DynamicControl


I have a DynamicControl (the type is date) and when the user pick a date I need to mark some check box. I think to use a JavaScript to do that, but I don't have the OnChange event in DynamicContro. How I can do that ?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend