Why use gridview




















Inside the Page Load event of the page, the GridView is populated with records from the Perons table of the AdventureWorks database. That's, it we are done, you can now Build and run your project in browser, you should see output like below. Ask a question Contribute an article Questions Articles.

Gridview in ASP. NET Gridview is a control in asp. The GridView control supports the following features:. This can help you to display and format tabular data very fastest way. We can format the gridview's nearly all parts as example header, row, alternate row, pager etc. Even we can place insert, edit, delete button for each row. In this simple example we create a default formatted GridView.

We also create a SqlDataSource control populate the data source by a simple database query. We fetch data from Northwind database customer table. The width of the Web Server is a negative value.

RowCommand is an event that performs a task when a button is clicked in the GridView control. It also enables you to perform custom routines whenever this event occurs. RowCreated is an event used to modify the contents of a row when a row is created. It also helps to determine the index of a row. RowDeleted is an event used to check the results of a deleted operation.

It also displays a message whenever the process is successful. RowUpdated helps to check the results of an updated operation. It also enables to perform custom routines and check the result.

Sorting is used to perform the sorting functionality when a GridView control is bound to a DataTable object by setting the data source property. DataBind binds a data source that invokes a server control and child controls with an option to raise the DataBinding event.

Dispose is a method that enables a server control to perform a cleaning operation before the release of memory. It leaves the grid control in an unusable state. FindControl is used to search the current naming container for the specific server control with the specified id parameter. RemovedControl is a method called immediately after a child control is removed from the controls collection of the control object.

InitializePage initializes the page row displayed when the paging feature is enabled. GridView row represents the pager row to initialize. LoadViewState loads the previously saved view state of the GridView control. This method is mainly used by the. OnBubbleEvent is a method used to pass the interface for server control hierarchy to the web server control.

Before creating a database table in Gridview, there are some prerequisites that you must keep in mind. With this, you have learned everything about ASP. NET GridView. Initially, you learned about the basics of ASP. Then you saw some properties and events of GridView.

Finally, you explored how to create a database table using GridView with a hands-on demo.



0コメント

  • 1000 / 1000