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

OpenAccessDataSource and Telerik.Web.UI.GridInsertionObject error

2 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jaimie
Top achievements
Rank 1
Jaimie asked on 13 Nov 2009, 03:50 AM
I use RadGrid with OpenAccessDataSource

Here is the definition of OpenAccessDataSource:
    <telerik:OpenAccessDataSource ID="DialogScriptDataSource" runat="server"   
        EnableDelete="True" EnableInsert="True" EnableUpdate="True"   
        ObjectContextProvider="EAGG.ORM.ObjectScopeProvider1, EAGG.ORM"   
        TypeName="EAGG.ORM.DialogAction" Where="DialogID = @DialogID"    
        oninserting="DialogScriptDataSource_Inserting" ContextTypeName=""   
        OrderBy="DialogActionOrder" onupdating="DialogScriptDataSource_Updating">  
        <WhereParameters> 
            <asp:QueryStringParameter DbType="Int32" Name="DialogID"   
                QueryStringField="Id" /> 
        </WhereParameters> 
    </telerik:OpenAccessDataSource> 


Then i use the open access data source as the RadGrid DataSource. The RadGrid is using EditTemplate for editing. If there are records from WhereParameter result, i could do edd, insert, delete to the RadGrid. However, if the return result of the OpenAccessDataSource is nothing, when i click add new record, i got this error message :

DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'DialogActionTypeID'.

I know you could bind default values for case like this, however this behaviour doesn't happen to OjectDataSource or SqlDataSource, plus i don't want to predefine all the values for insert.

Is this the designed behaviour of OpenAccessDataSource or did i do something wrong?

jaimie

 

 

2 Answers, 1 is accepted

Sort by
0
Jaimie
Top achievements
Rank 1
answered on 13 Nov 2009, 05:16 AM
An example of what i try to achieve here:

If i have tow pages. Page One is a cutomer list, page tow is a customer order list.

For Page one, its just a customer list with a Customer OpenAccessDataSource. (connected to customer ORM class)

For Page Two its a RadGrid with a Order OpenAccessDataSource. (connected to order ORM class)

In Page one, if i select a customer, it will redirect to Page Two with the current customerID as QueryString

so like Response.Redirect("order.aspx?CustomID=" + CustomerID);

In Page Two, the order OpenAccessDataSource should load data according to the QueryString CustomID, then bind to the RadGrid in Page Two for insert, update, delete of the orders for the passed customer.

NOW, here is the problem:

If order OpenAccessDataSource returns records according to the custom ID, everything is fine. I could do insert, update, delete.

However if order OpenAccessDataSource returns no records, when i click "add new record", i will have the error message like before.

Hope this happens with the understand of the situation.
0
Zoran
Telerik team
answered on 16 Nov 2009, 02:29 PM
Hello Jaimie,

We verified the bug you reported and it is fixed already by our team. The fix will be available in the next OpenAccess service pack/internal build. Thank you for your colaboration. Your Telerik points were updated.

Greetings,
Zoran
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Jaimie
Top achievements
Rank 1
Answers by
Jaimie
Top achievements
Rank 1
Zoran
Telerik team
Share this question
or