Saturday, June 26, 2004

(.NET - ASP.NET) How to Play with DataGrid Control

Datagrid, one of the most frequently used controls in ASP.NET is also a mystique for many. This article explains in detail as to how to work on that and make use of its different properties.

The explanation is in detail with example that cvers all the possbile features of Datagrid, its events, and methods. Checkbox control , the one that we use for selecting rows is also explained.

DatePicker and Calendar are two controls, which when used with Datagrid become complicated. Unfortunately,these were not explained here. Had they been explained, the task would ahve been easy for many developers.

Infact, usage of Calendar control inside a datagrid is something where I do errors and I am still looking for proper guidance on that.

EXcerpt from the article:
This article provides a demo of how to divide up data into pages. Mayank Gupta illustrates how to automatically create pages containing the number of rows you require and how to make a custom interface.
Introduction

One example of using the DataGrid control to display data is the use of “paging”. When you have a large number of rows to display, sending them all to the client in one group at once doesn’t make sense. Your client will get impatient waiting for them all to arrive and may find that they actually wanted to see something else instead. To prevent this aggravation and waste of bandwidth, we actually divide the output into pages containing 10 –20 rows per page.

DataGrid web control makes it easy to provide a paging feature. It contains logic that can automatically create pages containing the number of rows you require, and it can render the navigation control in a range of ways. You can also take over paging entirely and implement all the features yourself to provide a custom interface.

No comments: