OpenAccessDataSource and Telerik.Web.UI.GridInsertionObject error

Thread is closed for posting
3 posts, 0 answers
  1. Jaimie
    Jaimie avatar
    33 posts
    Member since:
    Mar 2008

    Posted 12 Nov 2009 Link to this post

    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. Jaimie
    Jaimie avatar
    33 posts
    Member since:
    Mar 2008

    Posted 12 Nov 2009 Link to this post

    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.
  3. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 16 Nov 2009 Link to this post

    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.
Back to Top