Create an OpenAccessLinqDataSource dynamically

Thread is closed for posting
2 posts, 0 answers
  1. Les
    Les avatar
    29 posts
    Member since:
    Feb 2011

    Posted 24 Jul 2012 Link to this post

    In C# I would like to create an OpenAccessLinqDataSource dynamically in the code behind during a page load. I then will add it to the Radgrid's datasource.
    I have the the Domains set up in a Entities Diagram.
    I have not seen any examples of doing this...Should the following work?

                    Telerik.OpenAccess.Web.OpenAccessLinqDataSource ds = new Telerik.OpenAccess.Web.OpenAccessLinqDataSource();
                    ds.ContextTypeName = "Appname.EntitiesModelxxx";
                    ds.EntityTypeName = "TestName";
                    ds.ID = "dsTestDatasource";
                    ds.EnableDelete = true;
                    ds.EnableUpdate = true;
                    ds.EnableInsert = true;
                    RadGrid1.DataSourceID = "";
                    RadGrid1.DataSource = ds;

  2. Zoran
    Zoran avatar
    534 posts

    Posted 25 Jul 2012 Link to this post

    Hi Les,

     Code like this should definitely work in your application. We are actually using similar code in order to write unit-tests against our datasource with the MsTest framework.

    the Telerik team
    OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Back to Top