Click here to Skip to main content
Licence 
First Posted 12 Feb 2007
Views 7,321
Bookmarked 9 times

Tips using DataGrids

By | 12 Feb 2007 | Article
Tips on using DataGrids when programming using .Net

ASP.NET Performance when using DataGrid

I am here to give you three tips whn using Grids when developing web applications using asp.net 1.1. When I was developing my web site www.arabiahotjobs.com I faced almots every problem a software developer will encounter while developing SDLC projects.

these are a few tips using Grids you should consider

1- Try not to use Column Bound instead use ItemTemplate when its possible. Using itemTempalte you will have a full control over the server controls. On the DataGrid ItemDataBound event you can control the formate or validate/change the content of items to be displayed.

2- If the data returend by the Dataset to the DataGrid are 1000's of records for 1000's of users try to use Data readers and Paging rather than adapters and datasets. you can search this website on Paging.

3-Grid's viewstate takes almost double size of the remaining page on bytes. try to set viewstate = false when its possible. Remeber that you do not need to PostBack
when you are navigating from one page to others independantly.

4- Make sure bind the Data in a function call BindData() and only to be called on
If (!PostBack) { BindData(); };
Otherwise you will end-up bing every page postback even if you are redirecting to another page.

5- if you grid is in the main (default) page and is only can be changed occationally (a few times a day) for example (HotJobs of the week), try to use a grid inside a cashed usercontrol (say to be cahed every 4 hours)

I hope that these tips will help you.

Nahed Kadih
Jobs in Middel East
www.arabiahotjobs.com
Software Architect

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Nahed Qudieh

Web Developer

United States United States

Member

Nahed Qudieh, CIO
 
Nahed Qudieh is the Chief Information Officer(CIO) of Arabia! HotJobs (Jobs in Middle East). He holds a Masters degree in Computer Science and Information Technology from University of Central Florida (USA)and has over 15 years of IT industry experience in both the operational and business development. As a member of the senior management team, Nahed is actively involved in key alliances, capacity growth, process initiatives, business development and delivery. Prior to promoting Arabia! HotJobs, he has worked as a Solution Architect for a large US and Saudi companies (NexTel, Globe Wirless and Saudi Aramco), responsible for the design, development and implementation of large IT projects.(nKadih@ArabiaHotJobs.com)

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 12 Feb 2007
Article Copyright 2007 by Nahed Qudieh
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid