Gridview in asp net c#
In this article I will explain what is gridview in asp net? In my next article I will explain how to display data in grid view using asp net gridview examples.
Gridview is a control which can displays the values of data source in a tabular format where each column represents a header field and each row represents a values. Asp net GridView control enables you to display, Sort and edit data. Using Gridview in asp net C# you could display complete data, you could perform sorting and paging.Gridview in asp net not only display the entire data grid view control can used to insert, delete and update data. Gridview in asp net enables you to easily connect to database.
Following are some basic but useful properties
Grid view Controls Behavior
|True or False. It shows whether the control should support paging.
|True or False. Indicate whether the control should support page sorting.
|Obtain the current sort expression that shows the order of the row.
|Direction of sort (ascending or descending )
|Data source object that consist of the data.
|True or False. Indicates whether a different column should be attach to edit the record.
|True or False. Indicates whether another column should be insert to delete the record.
|This property indicate style of every alternate row in asp net gridview
|This style is used to edit row in edit view
|This property indicate style of the rows in GridView.
|If AllowPaging is true then this Defines Pager of the GridView
|This property mostly worked when there is no data.
|It is used to indicate style properties of the header of the asp net GridView.
|It is used to indicate style properties of the footer of the asp net GridView.
Indicates the area in pixel between the cells and border of the GridView.
|Indicates the area in pixel between the cells.
It Indicates whether Lines should require or not, if yes then Horizontal, Vertical or Both.
|It shows the horizontal range of the GridView.
|Define whether the footer should require or not.
|Define whether the Header should require or not.
|It received URL of image which will shown in back ground.
State for Grid View Control
|All collected objects are represent using columns.
|Indicate gridview object which is appear in footer in asp net gridview.
|Gives a GridViewRow object that shown the header of the GridView.
|Gets the total number of the pages required to show the records of the data source.
|Obtain a collection of GridViewRow objects that represents the currently appears rows in the GridView.
|Primary key for gridview.
|Collection of Data Key that represent the value of the primary key set in Data Key Names of GridView.
Events in GridView Control
|PageIndexChanging and PageIndexChanged events occur when the page link is fired. They launch before and after Grid View handles.
|This event is launches when Cancel button is fired in edit mode of asp net grid view.
|This event is fires when a clicked on any row of asp net GridView.
|This event occur when a new row is produce in GridView.
|This event fire when row is bound to the data in GridView.
|RowDeleting and RowDeleted both are fires when Delete button is clicked. They launch before and after Grid View handles deleting work of the row respectively.
|Its perform when a Edit button is clicked but before the Edit operation.
|RowUpdating and RowUpdated both events fire when a update is clicked. They fire before and after update operation respectively.
This is basic information of asp net gridview.In next Part I will explain how to display data in gridview using asp net GridView Tutorial.
GridView Control Example,Events of GridView,GridView Samples,