[You can see all new hierarchy modes of RadGridView in this week’s webinar. See details and register >>]
More and more developers are using ORM frameworks like Telerik OpenAccess, Entity Framework, and NHibernate to save valuable time from writing dependent and synchronization code for the database server. In many cases it is often necessary to create complex custom business objects that contain the object relations to support the different needs of the application like serialization (database, file storage, online service) and transactions.
In many of these scenarios the developers are looking for a convenient and quick way to visualize the data and execute sorting, filtering and/or grouping. Now they can with the newly extended hierarchical model of RadGridView, which comes with a Object-Relational Hierarchy mode. Here is a quick taste of how easy it is to use:
Let’s have the following entity model using the well-known Northwind database:
The new version of RadGridView can very easy generate and present this data by using a binding and the AutoGenerateHierarchy property of control:
NorthwindEntities entities =
var query = from suppliers
entities.Suppliers select suppliers;
.radGridView1.DataSource = query.ToList();
Here is the result of above lines of code:
Let’s look at another entity model from the Northwind database:
If we want to have better control over the presentation, for example which columns to show in the child template, or you want to show only a branch of the complex hierarchical structure, you can very easy setup the Object-Relational hierarchy manually:
sender, EventArgs e)
var query = from customers
entities.Customers select customers;
GridViewTemplate childTemplate = CreateChildTemplate();
GridViewRelation relation =
GridViewTemplate childTemplate =
GridViewTextBoxColumn column =
childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
And the result is nicely formatted hierarchy template which shows only the columns that we have defined:
What is best, Telerik GridView for WinForms takes care of all data operations such as grouping, sorting, and filtering automatically, and without requiring additional settings or coding. The grid also automatically starts the new-in-Q3 2010 mechanism for lazy data loading and processing, which gives better performance and decreases the memory footprint.
Download RadControls for WinForms Q3 2010 today to try these features yourself. Hopefully you will be as excited to use them, as we were to develop them. Next time I will go over using the new Object-Relational hierarchy with Telerik OpenAccess ORM. Let us know what other application scenarios and features you want to see in our blogs.
Also join the live webcast on What’s New in RadControls for WinForms and Telerik Reporting for a chance to win a Telerik Premium Collection (worth $1299):
Wednesday, November 17, 11 am Eastern Time: Register here >>
You can also register for some of the other webinars dedicated to the release and learn about all the major new features that ship with the Q3 2010 release. Book your seat for a chance to win a Telerik Premium Collection (worth $1299), a WebUI Test Studio Bundle ($2999) and a TeamPulse License for 10 users ($2490). Check schedule>>
Nikolay Diyanov Diyanov is the Product Manager of the Native Mobile UI division at Progress. Delivering outstanding solutions that make developers' lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.
Find him on Twitter @n_diyanov or on LinkedIn.
Copyright © 2017, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.