J
Jeronimo Bertran
I have a FormView that shows details of a specific record on a table. The
SelecMethod returns a DataSet that includes all the fields from my Event
table and other read-only fields from linked tables. My FormView has
controls that are bound to the fiuelds on the dataset table. I am now
changing the FormView's Default Mode to Edit but I am having problems with
the related fields.
My ObjectDataSource is defined as:
<asp:ObjectDataSource ID="ObjectDataSourceEventDetails"
runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectEventDetails" TypeName="EventData"
DataObjectTypeName="System.Data.DataSet" UpdateMethod="UpdateEventDetails">
<SelectParameters>
<asp:ControlParameter ControlID="GridViewEvents"
Name="eventID" PropertyName="SelectedValue"
Type="Int64" />
</SelectParameters>
</asp:ObjectDataSource>
The EventData.SelecEventDetails performs a join with related tables and
returns a single table in a dataset with both the Event fields and the
related fields.
The EventData.UpdateEventDetails funcion takes as parameters the
original_EventID and only the editable fields that belong to the Event
table.
public void UpdateEventDetails(long original_EventID, byte SendState,
string EntryNotes)
I added a button to save changes and when the button is pressed I called:
FormView1.UpdateItem(true);
When UpdateItem is called I receive the following exception:
Could not find a property named 'ImageIndex' on the type specified by the
DataObjectTypeName property in ObjectDataSource
'ObjectDataSourceEventDetails'.
ImageIndex is a field found on a related table which is not updated by
UpdateEventDetails.
I am not sure if I should limit the SelectMethod to return the table and
do the databinding for the read only fields a different way.
Thanks
Jeronimo Bertran
SelecMethod returns a DataSet that includes all the fields from my Event
table and other read-only fields from linked tables. My FormView has
controls that are bound to the fiuelds on the dataset table. I am now
changing the FormView's Default Mode to Edit but I am having problems with
the related fields.
My ObjectDataSource is defined as:
<asp:ObjectDataSource ID="ObjectDataSourceEventDetails"
runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="SelectEventDetails" TypeName="EventData"
DataObjectTypeName="System.Data.DataSet" UpdateMethod="UpdateEventDetails">
<SelectParameters>
<asp:ControlParameter ControlID="GridViewEvents"
Name="eventID" PropertyName="SelectedValue"
Type="Int64" />
</SelectParameters>
</asp:ObjectDataSource>
The EventData.SelecEventDetails performs a join with related tables and
returns a single table in a dataset with both the Event fields and the
related fields.
The EventData.UpdateEventDetails funcion takes as parameters the
original_EventID and only the editable fields that belong to the Event
table.
public void UpdateEventDetails(long original_EventID, byte SendState,
string EntryNotes)
I added a button to save changes and when the button is pressed I called:
FormView1.UpdateItem(true);
When UpdateItem is called I receive the following exception:
Could not find a property named 'ImageIndex' on the type specified by the
DataObjectTypeName property in ObjectDataSource
'ObjectDataSourceEventDetails'.
ImageIndex is a field found on a related table which is not updated by
UpdateEventDetails.
I am not sure if I should limit the SelectMethod to return the table and
do the databinding for the read only fields a different way.
Thanks
Jeronimo Bertran