Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > FormView DataBinding in Insert mode

Thread Tools

FormView DataBinding in Insert mode

Anders Skoglund
Posts: n/a

I'm using the FormView control in combination with an ObjectDataSource
control to handle insert and update operations. The ObjectDataSource control
has a DataObjectTypeName defined that stores the information for each field.
When entering Insert Mode I would like to Bind the FormView control to get
default values filled in automatically. The problem is that the FormView
Controls doesn't seem to be Bindable in Insert mode:

if (frvDetails.CurrentMode == FormViewMode.Insert)
// Change Select method to Get a special instance of DataObjectTypeName
ods.SelectMethod = "GetDefaultValues";
// Remove the SelectParameter, since no key is necessary
// Bind the FormView control

The ObjectDataSource fetches the record (The Selected event returns an
Instance of type defined in DataObjectTypeName), but FormView never Binds to
the returned record. I manually changed the mode of the FormView control to
Edit, and then it worked as expected. There seems to be no way to make
DataBinding operations in insert-mode!?

Thanks in advance,

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Formview template insert to edit mode =?Utf-8?B?QW5u?= ASP .Net 1 05-01-2007 02:50 AM
FormView/Insert template / DropdownList / DataBinding Just Me ASP .Net 1 04-17-2007 07:38 PM
Formview with no select, insert only mode and via a stored procedure.. Possible???? jobs ASP .Net 0 11-08-2006 08:49 PM
Formview dropdownlist won't populate in insert mode, but does in edit mode ??? jobs at webdos ASP .Net Web Controls 0 10-09-2006 03:38 PM
Formview insertitemtemplate won't populate dropdownlist in Insert Mode jobs at webdos ASP .Net 0 10-09-2006 03:35 PM