This is a migrated thread and some comments may be shown as answers.

RadGrid, ObjectDataSource and Parameters

1 Answer 289 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Thiago asked on 20 Jun 2010, 03:11 AM
Hey there,

I've got a RadGrid bound to an objectDataSource but I've been running into an odd situation, on my grid I got the following declared:
<telerik:GridDropDownColumn DataField="Continent.Id" HeaderText="Continente" DataSourceID="odsContinent" ListTextField="Name" ListValueField="Id" UniqueName="Continent" SortExpression="Continent" />

The problem is, regardless of the params I set on my objectDataSource I am not able to switch the param name from Continent.Id to something I could name a parameter on C# Code, so I always end up with the following error when trying to update an item:

"Sys.WebForms.PageRequestManagerServerErrorException: ObjectDataSource 'odsCountry' could not find a non-generic method 'GridUpdate' that has parameters: Alias, Fullname, Capital, Continent.Id, ThreeDigitCountryCode, ThreeLetterCountryCode, TwoLetterCountryCode, Id."

<asp:ObjectDataSource ID="odsCountry" runat="server" 
            InsertMethod="GridInsert" DeleteMethod="GridDelete" UpdateMethod="GridUpdate"             
            MaximumRowsParameterName="maxResults" > 
                <asp:Parameter Name="Id" Type="Int32" /> 
                <asp:Parameter Name="Id" Type="Int32" /> 
                <asp:Parameter Name="Alias" Type="String" /> 
                <asp:Parameter Name="Fullname" Type="String" /> 
                <asp:Parameter Name="Capital" Type="String" /> 
                <asp:Parameter Name="Continent" Type="String" /> 
                <asp:Parameter Name="ThreeDigitCountryCode" Type="Int32" /> 
                <asp:Parameter Name="ThreeLetterCountryCode" Type="String" /> 
                <asp:Parameter Name="TwoLetterCountryCode" Type="String" /> 
                <asp:Parameter Name="Id" Type="Int32" /> 

Thanks for your time :)


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 22 Jun 2010, 12:00 PM
Hi Thiago,

There are several way to correct the error you are getting:
     - You should use ObjectDataSource's Updating event to modify the constructed InputParameters list (passed through the event's argument object).
    - Consider handling the CUD operations manually, instead using DataSourceControl
    - Consider setting the column as ReadOnly thus its values will not be added to InputParameters collection

All the best,
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question