Blue Theme Orange Theme Green Theme Red Theme
 
Home | Forums | Videos | Photos | Blogs | E-Books | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article 
 Login Close
User Id:
Password:
 
Forgot Password
Forgot Username
Why Register
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
New MS SQL 2008 Available - DiscountASP.NET
 Resources  
Close
 Our Network  
Close
Search :       Advanced Search »
Home » Mobile & Embedded » Grid control on .NET Compact Framework

Grid control on .NET Compact Framework

In this article I will show some typical issues one can encounter when developing mobile applications and how to solve them using a grid control that was designed for mobile devices from the scratch.

Technologies: .NET Compact Framework, Mobile Internet Toolkit,Visual C# .NET
Total downloads :
Total page views :  3513
Rating :
 0/5
This article has been rated :  0 times
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
 
ArticleAd
Become a Sponsor




There are many differences between .NET Framework and .NET Compact Framework, yet many developers port their desktop applications to mobile platforms as if they were the same. Microsoft did some great work by creating the .NET Framework and the .NET Compact Framework which made the porting much easier. Still there are many peculiarities of the .NET Compact Framework which a good developer must consider. Taking a desktop solution, removing the unsupported methods and recompiling for Compact Framework often works, but leads to applications that don't look good (often because of the removed unsupported methods), are difficult to control (because they were designed to be used on a desktop which relies on a mouse) and are slow (simply because the processor speed is 5 times or even slower than on a desktop).

Let's have a look at standard Visual Studio DataGrid - a popular control among .NET developers which can be used to display data in tabular form. The problem with the compact version of DataGrid is that it was designed for desktop environment and then just dropped into the .NET CF. In this article I will show some typical issues one can encounter when developing mobile applications and how to solve them using a grid control that was designed for mobile devices from the scratch.

Data loading

DataGrid is a fine control when working with ADO.NET. However, ADO.NET is not very useful on .NET CF, because it copies the entire database into memory which is both slow and memory consuming. Furthermore, there is no simple way to manually insert new rows of data into the DataGrid instead of using data binding. Resco SmartGrid for .NET CF does not only provide a simple way of adding new rows of data, but most importantly ease of manipulation and customization that can be implemented using Visual Studio's designer. Adding data rows means adding Row objects to the SmartGrid's collection of rows.

Graphics capabilities

Whereas on a desktop computer the user can still quite comfortably view a 20 column grid, on a mobile device showing even 4 columns can pose a problem. On a mobile device each pixel is precious and potentially useful to render data. Plain text is very universal for describing various data types, but is also space consuming. To make the most of every pixel on the screen, using the graphics helps a lot.

Imagine that we have a database table containing the names of products, the monthly sales volumes in USD, the percentage of increase or decrease compared to the previous month and stocking information. Such information can be described using text (which is the only option when using DataGrid) or it can be graphically depicted as seen on Figure 1. The color of numbers in monthly sales already tells the user whether there was an increase or a decrease. The arrow icons are therefore not even necessary but they improve the user's ability to quickly tell the increased products from the decreased ones. The checkbox is also a much more convenient indicator of stock availability than plain True/False text strings or 1/0 numbers. The shopping-cart icon can provide even more information on readiness of the product for sale. Developers can easily handle the click on the shopping-cart icon and perform a meaningful action such as displaying an ordering form.



Figure 1

Delayed Load

One of the big concerns of mobile device application development is speed. If the database table contains many rows, it may take a long time to load and display the data. However, this is not true with Resco SmartGrid for .NET CF, because of its Delayed Load technology. When this feature is engaged, the SmartGrid only loads the data currently visible and loads the additional ones on demand. The feature causes the application to show a grid form in a second no matter how many rows the underlying table contains. In cases where a mobile application is connected online to a remote database the Delayed Load makes the application more responsive and also places less load on the database server.

Built-in auto editing

Although the grid control is mostly used for displaying data, there are situations when it is convenient to use it also for data editing. For this purpose Resco SmartGrid supports the built-in auto edit. This feature allows the developers to set the SmartGrid's column so it automatically shows a suitable control allowing the user to edit column data. It's possible to use TextBox, CheckBox, or any other existing custom control to edit data. Figure 2 shows the Resco SmartGrid used in an ordering form.

   

Conclusion

To optimally port an application from desktop computer to a mobile device can be tricky. Choosing appropriate controls brings certainly more satisfactory results in the sense of application's speed, professional look and comfort in its use. Resco SmartGrid is a .NET Compact Framework control designed specifically for mobile devices. Except of its numerous advanced features (such as touch scrolling, delayed load, XML serialization), it is a powerful substitute for the standard Visual Studio DataGrid control.

Resco SmartGrid control is part of Resco MobileForms Toolkit. You can find more information about Resco MobileForms Toolkit here.


Login to add your contents and source code to this article
 [Top] Rate this article
 About the author
 
Vladimir Gregor
I have over 2 years experience in IT industry. I hold a bachelor degree in Computer Systems and Networking. I am responsible for marketing at Resco and product management.
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
 
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
Boost the performance of your .NET applications
“ANTS Profiler took us straight to the specific areas of our code which were the cause of our performance issues." Terry Phillips, Sr. Developer, Harley-Davidson Dealer Systems. Download your free trial of ANTS Profiler.
Go.NET
Build custom interactive diagrams, network, workflow editors, flowcharts, or software design tools. Includes many predefined kinds of nodes, links, and basic shapes. Supports layers, scrolling, zooming, selection, drag-and-drop, clipboard, in-place editing, tooltips, grids, printing, overview window, palette. 100% implemented in C# as a managed .NET Control. Document/View/Tool architecture with many properties&events. Optional automatic layout.
Dundas Software
Dundas Chart for .NET is the most advanced .NET charting package available today.  With an extremely complete feature set, elegant architecture and easy implementation, Dundas Chart can quickly add advanced Charting functionality to enhance and transform ASP.NET and Windows Forms applications.  Whether you are implementing charting into internal projects, or building applications for clients, Dundas Chart offers advanced technology and advanced results to get the most out of data.
 
   Print Read/Post comments Post a comment  Rate  
   Email to a friend  Bookmark  Similar Articles  Author's other articles  
 
 Post a Feedback, Comment, or Question about this article
Subject:  
Comment:  
ArticleAd
Become a Sponsor
Latest Comments:
Subject Posted By Posted On

 Hosted by MaximumASP  |  Found a broken link?  |  Contact Us  |  Terms & conditions  |  Privacy Policy  |  Site Map  |  Suggest an Idea  |  Media Kit
Current Version: 5.2009.6.2
 © 1999 - 2009  Mindcracker LLC. All Rights Reserved