I have a EditFormSettings FormTemplate inside a RadGrid that contains two comboboxes:
(Looks something like this):
Simple enough... There are two RadComboBoxes with two different ObjectDataSources applied. The ObjectDataSources look like this:
Note, the ObjectDataSource of interest is the second, as it has a dependency on the first for one of its SelectParameters. When the page loads, I get an error stating:
Is it possible to use ObjectDataSources with parameter dependencies inside an edit form? If not, is there a work around?
Thanks in advance,
Tim
PS. I've tried the $ sign trick some other have posted.. No dice. (Inspected the client "name" attribute for the input control of the RadComboBox --
(Looks something like this):
<FormTemplate> |
<table> |
<tr> |
<td> |
Inventory Name: |
</td> |
<td> |
<telerik:RadComboBox SelectedValue='<%# Bind( "InventoryId") %>' ID="RadComboBoxInventoryName" runat="server" Height="300px" Width="300px" |
Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false" |
DataSourceID="ObjectDataSourceInventoryName" DataTextField="Name" DataValueField="InventoryId" AutoPostBack="true"> |
<Items> |
<telerik:RadComboBoxItem Text="" Value="" Selected="true" /> |
</Items> |
</telerik:RadComboBox> |
</td> |
</tr> |
</tr> |
<tr> |
<td> |
Attribute: |
</td> |
<td> |
<telerik:RadComboBox Text='<%# Bind( "Attribute") %>' ID="RadComboBoxAttribute" runat="server" Height="300px" Width="300px" |
Filter="Contains" MarkFirstMatch="true" ChangeTextOnKeyBoardNavigation="false" |
DataSourceID="ObjectDataSourceAttribute" DataTextField="Attribute" DataValueField="Attribute" AutoPostBack="true"> |
<Items> |
<telerik:RadComboBoxItem Text="" Value="" Selected="true" /> |
</Items> |
<ItemTemplate> |
<%# DataBinder.Eval(Container.DataItem, "Type")%>.<%# DataBinder.Eval(Container.DataItem, "Attribute")%> |
</ItemTemplate> |
</telerik:RadComboBox> |
</td> |
</tr> |
<tr> |
<td align="left" colspan="2"> |
<asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> |
</asp:Button> |
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" |
CommandName="Cancel"></asp:Button></td> |
</tr> |
</table> |
</FormTemplate> |
<asp:ObjectDataSource ID="ObjectDataSourceInventoryName" runat="server" |
TypeName="Ams.Web.BackOffice.InventoryAdapter" |
DataObjectTypeName="Ams.Core.DomainObject.Inventory" |
OldValuesParameterFormatString="original_{0}" |
ConflictDetection="CompareAllValues" |
SelectMethod="GetInventoryForComboBox"> |
</asp:ObjectDataSource> |
<asp:ObjectDataSource ID="ObjectDataSourceAttribute" runat="server" |
TypeName="Ams.Web.BackOffice.InventoryTypeAttributesAdapter" |
DataObjectTypeName="Ams.Core.DomainObject.InventoryAttribute_InventoryType" |
OldValuesParameterFormatString="original_{0}" |
ConflictDetection="CompareAllValues" |
SelectMethod="GetAttributeByInventoryId"> |
<SELECTPARAMETERS> |
<asp:ControlParameter Name="aInventoryId" PropertyName="SelectedValue" ControlID="RadComboBoxInventoryName" /> |
</SELECTPARAMETERS> |
</asp:ObjectDataSource> |
Note, the ObjectDataSource of interest is the second, as it has a dependency on the first for one of its SelectParameters. When the page loads, I get an error stating:
Could not find control 'RadComboBoxInventoryName' in ControlParameter 'aInventoryId'.
Basically, it reports that it cannot find the control for the aInventoryId parameter (as its not rendered on the page yet).Is it possible to use ObjectDataSources with parameter dependencies inside an edit form? If not, is there a work around?
Thanks in advance,
Tim
PS. I've tried the $ sign trick some other have posted.. No dice. (Inspected the client "name" attribute for the input control of the RadComboBox --