Dynamic Data and Open Access

19 posts, 0 answers
  1. Gavin
    Gavin avatar
    1 posts
    Member since:
    May 2009

    Posted 11 Oct 2009 Link to this post

    Hi there,

    Please will you provide some guidance on how to use Open Access with Microsoft's Dynamic Data. A sample project would be great!

    Many thanks.

    Gavin
  2. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 14 Oct 2009 Link to this post

    Hello Gavin,

    Telerik OpenAccess ORM team is already developing in the direction of integration our product with Dynamic Data features. The IUpdatable interface required by the framework is implemented in our Data Context class which you can find in the Telerik.OpenAccess.40 assembly. We would appreciate if you could give us some suggestions/requirements about the functionality that you would like to see implemented in the future. Also I must assure you that our Telerik Data Wizard will support DynamicData development in one of the releases to come.

    Regards,
    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.
  3. DevCraft banner
  4. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 29 Mar 2011 Link to this post

    Hi Zoran,

    Am I missing a thread or is it not available:

    Is it possible to use open access as a context provider for a Dynamic Data (entities) Web Application? 

    Regards,

    Erik
  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 30 Mar 2011 Link to this post

    Hello Proovit,

    Yes, you could use the Telerik OpenAccess ORM with Dynamic Data. We prepared examples which demonstrate this functionality. The examples are shipped with the Telerik OpenAccess SDK Browser.
    Hope that helps.

    Best wishes,
    Damyan Bogoev
    the Telerik team
  6. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 31 Mar 2011 Link to this post

    Thanks Damyan,

    That was all I need! had some problems with the browser because of an installing issue (I installed on E:, but ORMthen installes some on C: and some on E: and the browser does not work. Posted that in a ticket already.)

    Thanks,

    Erik
  7. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 31 Mar 2011 Link to this post

    Hi Proovit,

    Firstly I want to thank you for the valuable input.
    We will investigate the cause for this issue and fix it. Currently we are working on the next version of the Product SDK.
    You could find your Telerik points updated.

    Regards,
    Damyan Bogoev
    the Telerik team
  8. okan
    okan avatar
    8 posts
    Member since:
    May 2011

    Posted 18 May 2011 Link to this post

    Hi,
    is there any sample where we can use both OpenAccess ORM and ASP.net Ajax controls together.
    OpenAccess  sdk contains dynamicdata sample and I found some code samples from telerik blogs where they replace aspgrid and some other editor controls. But I couldn't merge those samples together.

    Regards
    Okan
  9. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 18 May 2011 Link to this post

    Yes, was thinking about that to Okan.
  10. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 19 May 2011 Link to this post

    Hello Erik,

    @Okan: Yes, there are samples that use both Telerik OpenAccess ORM and ASP.NET AJAX controls. You could look at the examples under the ASP category.
    Hope you will find them useful.

    Kind regards,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  11. okan
    okan avatar
    8 posts
    Member since:
    May 2011

    Posted 20 May 2011 Link to this post

    Hi Damyan,
    I think I couldn't make myself clear
    Is there any dynamic data sample where we can use both OpenAccess ORM and ASP.net Ajax controls (RadGrid,etc.) together?Becasue I could'nt find any dynamic data sample in SDK which contains both orm and for example radgrid.

    I tried to make dynamicdata web site by combining OpenAccess ORM and ASP.net Ajax samples that I found on the telerik forums and blogs. I managed to display orm datasource's data in rad-grid in a dynamicdata web site.

    But there are some minor problems like:CRUD operations is not working :) But i can say that at least my project looks better than standart Visual Studio dynamic data website thanks to Telerik Radgrid. You can find modified partition of DynamicRadGrid.cs below. But my project needs  more work. In the mean time I would be happy to see openaccess q2 2011 coming with dynamicdata support.




    DynamicRadGrid.cs
    protected override void OnInit(EventArgs e){
               base.OnInit(e);
     
               AllowAutomaticUpdates = true;
               AllowAutomaticDeletes = true;
     
               MetaTable metaTable = this.FindMetaTable();
     
               List<string> list = new List<string>();
               foreach (MetaColumn column in metaTable.PrimaryKeyColumns)
               {
                   list.Add(column.Name);
               }
               MasterTableView.DataKeyNames = list.ToArray();
     
               foreach (MetaColumn column in metaTable.Columns)
               {
                   if (!column.Scaffold || column.IsLongString )
                   {
                       continue;
                   }
                   if (column is MetaForeignKeyColumn)
                   {
                       GridHyperLinkColumn link = new GridHyperLinkColumn();
                       link.DataNavigateUrlFormatString = "~/" + ((MetaForeignKeyColumn)column).ParentTable.Name + "/ListDetails.aspx?" + metaTable.PrimaryKeyColumns[0].Name + "={0}";
                       string[] navigateFields = new string[] { metaTable.PrimaryKeyColumns[0].Name };
     
                       link.DataNavigateUrlFields = navigateFields;
                       link.DataTextField = column.Name;
     
                       link.HeaderText = column.DisplayName;
                       MasterTableView.Columns.Add(link);
                   }
                   else if (column.GetType().FullName == "System.Web.DynamicData.MetaChildrenColumn")
                   {
                       GridHyperLinkColumn link = new GridHyperLinkColumn();
                       link.DataNavigateUrlFormatString = "~/" + ((MetaChildrenColumn)column).ChildTable.Name + "/ListDetails.aspx?" + metaTable.PrimaryKeyColumns[0].Name + "={0}";
                       string[] navigateFields = new string[] { metaTable.PrimaryKeyColumns[0].Name };
     
                       link.DataNavigateUrlFields = navigateFields;
                       link.DataTextField = column.Name;
     
                       link.HeaderText = column.DisplayName;
                       MasterTableView.Columns.Add(link);
                   }
                   else
                   {
                       DynamicGridBoundColumn gridColumn = new DynamicGridBoundColumn();
     
                       gridColumn.DataField = column.Name;
                       gridColumn.ConvertEmptyStringToNull = column.ConvertEmptyStringToNull;
                       gridColumn.DataFormatString = column.DataFormatString;
                       gridColumn.UIHint = column.UIHint;
                       gridColumn.HtmlEncode = column.HtmlEncode;
                       gridColumn.NullDisplayText = column.NullDisplayText;
                       gridColumn.ApplyFormatInEditMode = column.ApplyFormatInEditMode;
                       gridColumn.HeaderText = column.DisplayName;
     
                       MasterTableView.Columns.Add(gridColumn);
                   }
     
               }
  12. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 25 May 2011 Link to this post

    Hi Erik,

    We will prepare a sample application that uses RadGrid with Telerik OpenAccess ORM and Dynamic Data. Once we implement it we will provide it to you.
    I am sorry for the inconvenience caused.

    Greetings,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  13. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 07 Jun 2011 Link to this post

    Looking forward to that.... and so is Okan I believe... 
    :-)
  14. okan
    okan avatar
    8 posts
    Member since:
    May 2011

    Posted 07 Jun 2011 Link to this post

    After trying to figure out a way to combine examples for several hours I gave up  and started to wait for working example from Telerik :))
    Edit: Is there any chance that we can get nightly build for open access ORM SDK?
  15. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 13 Jun 2011 Link to this post

    Hello okan,

    You could find the following blog post useful. It demonstrates how to use RadGrid with Dynamic Data.
    We will do our best to include the example in the next release of the Product SDK.
    Hope that helps.

    Greetings,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  16. okan
    okan avatar
    8 posts
    Member since:
    May 2011

    Posted 20 Jun 2011 Link to this post

    Hello Damyan,
    When I click the link I get server error
    http://blogs.telerik.com/Server-Error.aspx?aspxerrorpath=/sitefinity/cmsentrypoint.aspx
  17. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 20 Jun 2011 Link to this post

    Hello okan,

    Firstly I want to apologize for the inconvenience caused.
    It seems that the blog post’s Uri was changed. Now you could find it here.

    Greetings,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  18. Ajay
    Ajay avatar
    10 posts
    Member since:
    Apr 2011

    Posted 20 Jun 2011 Link to this post

    I am new to Telerik ORM
    Which scaffolding tool Do you recommend?
  19. okan
    okan avatar
    8 posts
    Member since:
    May 2011

    Posted 21 Jun 2011 Link to this post

    Thank you Damyan
    This really helps and I am looking forward to updated open access sdk dynamic data examples you mentioned earlier.

    Regards.
    Okan
  20. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 22 Jun 2011 Link to this post

    Hi Ajay,

    I am afraid that we do not provide such scaffolding tool.
    Actually you could implement partial classes to provide metadata information for each of the persistent capable classes that you want to use:

    [MetadataType(typeof(ProductsMetadata))]
    public partial class Products
    {
        [TableName("Products")]
        public class ProductsMetadata
        {
            [ScaffoldColumn(false)]
            public object ProductID { get; set; }
     
            [DisplayName("Product Name")]
            public object ProductName { get; set; }
     
            [DisplayName("Price"),DisplayFormat(DataFormatString = "{0:c}")]
            public object UnitPrice { get; set; }
     
            [DisplayName("Stock")]
            public object UnitsInStock { get; set; }
     
            [ScaffoldColumn(false)]
            public object ReorderLevel { get; set; }
     
            [ScaffoldColumn(false)]
            public object Discontinued { get; set; }
     
            [ScaffoldColumn(false)]
            public object QuantityPerUnit { get; set; }
     
            [ScaffoldColumn(false)]
            public object UnitsOnOrder { get; set; }
     
            [ScaffoldColumn(false)]
            public object Suppliers { get; set; }
     
            [ScaffoldColumn(false)]
            public object OrderDetails { get; set; }
        }
    }

    Hope that helps.

    Regards,
    Damyan Bogoev
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Back to Top
DevCraft banner