Site hosted by Angelfire.com: Build your free website today!

The ASP.NET GridView management is that the successor to the v1.x DataGrid, adding the flexibility to require advantage of specific capabilities of ASP.NET knowledge supply controls. Whereas the v1.x DataGrid needed a page developer to put in writing custom code to handle straightforward operations like paging, sorting, writing or deleting knowledge, the GridView management will mechanically handle these operations provided its certain knowledge supply management supports these capabilities. The GridView conjointly offers some practicality enhancements over the DataGrid, like the flexibility to outline multiple primary key fields, and a few UI customization enhancements, like new field varieties and templating choices. It conjointly exposes a replacement model for page developers to handle or cancel events.


One of the key blessings of the GridView management over different data-bound controls is its ability to mechanically profit of information supply capabilities. rather than hoping on page code to manually type or page knowledge, the GridView management will perform these operations mechanically as long because the knowledge supply is organized to support these operations. the subsequent example shows a GridView management with sorting enabled. It is very easy to do gridview insert update delete in asp.net.


The GridView comes with a try of complementary read controls: DetailsView and FormView. By combining these controls, you'll simply found out master-detail views victimization little code and generally no code the least bit. From the subsequent chapters you'll see some necessary operations in ASP.NET GridView management.


Before the GridView management is rendered, every row within the management should be sure to a record within the knowledge supply. The RowDataBound event is raised once {a knowledge|a knowledge|an information} row (represented by a GridViewRow object) is sure to data within the GridView management. this permits you to supply associate degree event-handling technique that performs a custom routine, like modifying the values of the information sure to the row, whenever this event happens. Gridview crud operation in asp .net c#.


A GridViewRowEventArgs object is passed to the event-handling technique, that allows you to access the properties of the row being certain. To access a selected cell within the row, use the Cells property of the GridViewRow object contained within the Row property of the GridViewRowEventArgs object. you'll verify that row sort (header row, data row, then on) is being certain by victimization the RowType property.