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

Grid to edit a view

1 Answer 39 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mat
Top achievements
Rank 1
Mat asked on 09 Feb 2015, 07:29 AM
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.

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 12 Feb 2015, 07:21 AM
Hi,

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.

Regards,
Angel Petrov
Telerik
 

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.

 
Tags
General Discussions
Asked by
Mat
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or