Hide fields generated for associations entity framework

S

steven scaife

Hello

I have been playing around with the EF and I really like it. The thing
bothering me at the moment is when I load an table in the dynamicdata pages
add select to insert a new item. The association is showing as a drop down
field.

I have a table that keeps reporting information about several other tables.
And this is a foreign key inside the item I am creating. so when I call
savechanges I have added my own logic to create a new tracking entity and
adding the object I want to create through the form to the tracking objects
entityset. This all works and the two records are inserted into the database.

However because each record I insert must have the primary key of the
tracking object saved with it, (which my code sorts) the drop down is
pointless and potentially confusing so how would I go about not showing it on
the data entry form.

Is there an attribute I can add to a partial class or can I intercept the
load event and write code to stop it being shown or do I have to create my
own page and forget about the dynamic pages in this type of scenario.

any help is really appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top