DataGrid control in ASP.Net 1.x is replaced by this control in ASP.Net 2.0 release and it is one of the most widely used controls. It provides more flexibility in displaying and working with data from your database in comparison with any other controls. The GridView control enables you to connect to a datasource and display data is tabular format, however you have bunch of options to customize the look and feel. When it is rendered on the page, generally it is implemented through <table> HTML tag.
Using this control is very easy when compared to other data bound controls to display data. Just assigning the DataSource property to a DataTable and calling DataBind() method will render the data.
Advantages:
- It is the only databound control which has inbuilt edit, update, delete, sort, paging data functionality. We can enable these functionalities by setting the properties of GridView without even writing a single line of code. So best choice for the CMS driven application’s admin module.
Disadvantages:
· The main disadvantage of GridView control is, it does not have the flexibility to display data in any other format except table. Gridview control will actually render the data in <Table> tag. Each column will be rendered as separate TD, which makes it not possible to display data in any other format.
· Using this control to just display data is really heavy because it loads the viewstate with state information to provide the inbuilt functionalities like sort, paging, etc. Disable the viewstate in this case if you are not using any of the inbuilt functionalities to improve the performance.
· The paging controls use JavaScript, which makes the pages inaccessible to search engine. But here are a few disadvantages of using the built in paging. It fetches all the records from the database even when we need only 10 records per page. This is quite inefficient when your tables have thousands of records. The paging controls use JavaScript, which makes the pages inaccessible to search engine.
No comments:
Post a Comment