Grid to edit a view

2 posts, 0 answers
  1. Stéphane
    Stéphane avatar
    15 posts
    Member since:
    Sep 2010

    Posted 09 Feb 2015 Link to this post

    Hi all,
    I'm new using this forum so I'll let you guys move my thread if I didn't place it within the proper section. I'm using C# 4 and ASP.Net. I'm using EntityFramework at version 4.1.10331.0 and Telerik at version 2012.1.228.40.

    I want to create a grid to allow my user to translate a few labels from our application. Basically, let's imagine I have two tables in my database :

    - Label : contains an Id and a Name.
    - Translation : contains an Id, a Label_Id a Language_Id, a Scope and a TranslatedValue.

    I want to display to my user a grid containing the following information :

    Label.Name | Translation.Value (for Language_Id = French) | Translation.Value (for Language_Id = English) | Scope

    I've found a way to do so using SQL (using pivot table) and now my query is done I would like to use it directly (if possible) in my code. Since I'm using a dynamic SQL query, I can't use a view, because it requires only a select. Furthermore, I want my user to be able to edit the TranslatedValue columns.

    What would be the best practice to do something like that with Telerik ?

    Thanks in advance for your precious help and advices.

  2. Angel Petrov
    Angel Petrov avatar
    1094 posts

    Posted 12 Feb 2015 Link to this post


    One possible realization would be to create a hierarchical grid in which the Translation table data will be displayed in the second level which allows data editing. An example of such a setup can be observed in this demo.

    Displaying and editing the data in a single level grid however would be difficult as the second and third columns refer to the same field Translation.Value. If however you manage to set a different name for the second and third fields and pass the data to the grid you should be able to later edit it. Since you mention that you are dynamically building the query you can use advanced data-binding for the grid and manually handler the insert/update and delete as demonstrated here.

    Angel Petrov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top