User1202816037 posted
I've encountered a problem that looks like a bug to me.
1. Create a custom DetailsView that will be used to present existing data and inserting new data
2. Add some required field and mark it as InsertVisible="false"
<Fields>
<asp:DynamicField DataField="SomeRequiredField" InsertVisible="false" />
/* ... other fields ... */
</Fields>
We want that field to be presented to the user when DetailsView is in ReadOnly mode, but we don't want the user to see it in Insert mode - it will be computed on the server side before insert.
3. Try to insert some data using that DetailsView.
Problem:
Message in ValidationSummary: "The SomeRequiredField field is required".
It turns out that this DynamicField is not rendered in Insert mode, but it's validators are added to the page. So nothing can't be inserted.
It's quite annoying because now I have to make two seperate DetailsView or mark this field in the DB as nullable... :( Any chance to fix it?