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

Automatic Delete has missing parameters

2 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Josh Bernard
Top achievements
Rank 1
Josh Bernard asked on 12 Oct 2008, 11:04 PM
I have wired up an Object DataSource control on the page to do the grunge work for me however when I try to Delete a record my target DeleteMethod does not get the parameters it requires. I have looked around on the help and it looks like the data is supposed to be extracted and available for me to use.

<asp:ObjectDataSource ID="DocLinkViewDataSource" runat="server" TypeName="DocumentsManager" 
        SelectMethod="getDocumentBranchLinkDS" 
        InsertMethod="CreateDocumentBranchLink" 
        UpdateMethod="UpdateDocumentBranchLink" 
        DeleteMethod="DeleteDocumentBranchLink">  
          
        .......  
 
        <DeleteParameters> 
            <asp:Parameter Name="BranchDatabase" Type="String" /> 
            <asp:Parameter Name="DocumentID" Type="String" /> 
            <asp:Parameter Name="BusinessType" Type="String" /> 
        </DeleteParameters> 
    </asp:ObjectDataSource> 

Public Sub DeleteDocumentBranchLink(ByVal BranchDatabase As String, _  
   ByVal DocumentID As StringByVal [BusinessType] As String

2 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 15 Oct 2008, 11:47 AM
Hello Josh,

Indeed the three parameters you specified using the DeleteParameters collection of your ObjectDataSource instance should be passed as arguments to your DeleteMethod. Can you please debug your code to see whether they are processed as expected and ensure that the AllowAutomaticDeletes property of the grid is set to true?

You may also review the project from this code library thread for further reference.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Josh Bernard
Top achievements
Rank 1
answered on 15 Oct 2008, 03:17 PM
Stephen,

I decided to change my stored procedure to only require the ID which is setup as a DataKeyName so it was available to me. If I remember correctly if I enabled the OldValuesParameterFormatString parameter on the datasource I was able to access these values.

Thanks
Tags
Grid
Asked by
Josh Bernard
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Josh Bernard
Top achievements
Rank 1
Share this question
or