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

Artificial fields and dynamic data

3 Answers 102 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Emil
Top achievements
Rank 1
Emil asked on 13 Oct 2010, 02:22 PM
Hi,
I have select statements and field descrptions for this statements saved in database.
What I have done in Delphi is by start of the application is to read one select statement, fields descriptions and some class description from database. From this statement I am creating a dataset and from fields and class description and then columns in a grid control with corresponding editors. I am trying to do the same in .Net with your compnents.
Is it possible to save an OpenAccess persistent class definition in DB nad by start of the application to read and create it dynamically?
Or maybe is possible to do it with an OpenAccess persistent class, create artificial fields from descriptions stored in database  for this class and dynamic binding to an editable GridView in WPF?
Or there is an easier way?

Regards,
Emil

3 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 18 Oct 2010, 06:36 PM
Hi Emil,

 Can you please provide a little more information. Usually it is not recommended to dynamically create the database during runtime, however we have API allowing you to do exactly this. At the moment we are working on implementing a Fluent API for defining mapping and extending the model with artificial types and properties and then persisting the changes to the database. We have released this API in the internal build last week, however the documentation is not yet up. You can have a look at this help article for more information.

I hope this is helpful.

Sincerely yours,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Emil
Top achievements
Rank 1
answered on 19 Oct 2010, 09:19 AM
Hi Serge,
we don't create any objects in database in runtime. What we want to achieve is following.
We have about 50 simple tables. For this tables we have a type of dictionary in database. This is a set of tables in which is stored information about these 50 tables. Small sample:
Lets say that we have a table Products. By start of application is an dynamic select statement loaded:
select prod_id,name,description,category,unit_type,qty_per_unit from products

Than the application loads the description of all these fields from dictionary in database. For sample the field unit_type is string 3 character long, who's title is "Units" and has an lookup editor who's values came from table units. The field's qty_per_unit is between 1 and 100 and so on. With this information are an editable DataGrid and corresponding editors created. And all this is by start of the application. Than the application behave  like is created only to edit the table products.
  We have created such applications with Delphi. But now we should move to .Net and I am looking for best possible way to achieve the same.

Regards,
Emil
0
Serge
Telerik team
answered on 22 Oct 2010, 10:07 AM
Hi Emil,

 You can use the information you have about the your products table to generate the column of the gridview in runtime. You can have a look at this help article about the WPF GridView in order to see how. And you can use the same information and implement fetch plans in your OpenAccess setup so that no unnecessary data is retrieved. More information on this here

I think this should be enough to get you started, if you however feel there is something else you need please let us know.

Best wishes,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Getting Started
Asked by
Emil
Top achievements
Rank 1
Answers by
Serge
Telerik team
Emil
Top achievements
Rank 1
Share this question
or