Why we use gridview
Raises the SelectedIndexChanging event. Raises the Sorted event. Raises the Sorting event. Raises the Unload event. Gets a Stream used to read a file. Binds the specified data source to the GridView control.
Raises the appropriate events for the GridView control when it posts back to the server. Called after a child control is removed from the Controls collection of the Control object. Renders the Web server control content to the client's browser using the specified HtmlTextWriter object.
Renders the HTML opening tag of the control to the specified writer. Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.
Renders the contents of the control to the specified writer. Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. Renders the HTML closing tag of the control into the specified writer. Saves the state of the properties in the GridView control that need to be persisted, even when the EnableViewState property is set to false.
Selects the row to edit in a GridView control. Puts a row in edit mode in a GridView control by using the specified row index. Sets the page index of the GridView control by using the row index. Assigns an event handler delegate to render the server control and its content into its parent control.
Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value. Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value. Sorts the GridView control based on the specified sort expression and direction. Tracks view-state changes to the GridView control so they can be stored in the control's StateBag object. This object is accessible through the ViewState property.
Occurs when the ModelDataSource object is being created. Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.
NET page is requested. Occurs when the server control is loaded into the Page object. Occurs when one of the pager buttons is clicked, but after the GridView control handles the paging operation. Occurs when one of the pager buttons is clicked, but before the GridView control handles the paging operation. Occurs after the Control object is loaded but prior to rendering. Occurs when the Cancel button of a row in edit mode is clicked, but before the row exits edit mode.
Occurs when a button is clicked in a GridView control. Occurs when a row is created in a GridView control. Occurs when a data row is bound to data in a GridView control. Occurs when a row's Delete button is clicked, but after the GridView control deletes the row. Occurs when a row's Delete button is clicked, but before the GridView control deletes the row. Occurs when a row's Edit button is clicked, but before the GridView control enters edit mode.
Occurs when a row's Update button is clicked, but after the GridView control updates the row. Occurs when a row's Update button is clicked, but before the GridView control updates the row. Occurs when a row's Select button is clicked, but after the GridView control handles the select operation. Occurs when a row's Select button is clicked, but before the GridView control handles the select operation.
Occurs when the hyperlink to sort a column is clicked, but after the GridView control handles the sort operation. Occurs when the hyperlink to sort a column is clicked, but before the GridView control handles the sort operation.
For a description of this member, see ControlBuilder. For a description of this member, see GetDesignModeState. For a description of this member, see SetOwnerControl Control.
For a description of this member, see UserData. For a description of this member, see DataBindings. For a description of this member, see HasDataBindings. Gets or sets the names of the primary key fields for the items displayed in a data-bound control. Gets or sets the table that is exposed by the data source control to bind to the data-bound control. Gets or sets the data source object from which the data-bound control retrieves the list of data items.
Gets or sets the ID of the data source from which the data-bound control retrieves the list of data items. Gets a collection of objects that represent the DataKeys value in a data-bound control. For a description of this member, see Expressions. For a description of this member, see HasExpressions. Gets or sets the control that automatically generates the columns for a data-bound control for use by ASP.
NET Dynamic Data. For a description of this member, see DataKey. Creates a PostBackOptions object that represents the postback behavior of the specified button control. Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services.
Privacy policy. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. WebControls Assembly: System. Note If you are familiar with the DataGrid control from the. Note Automatically generated column fields are not added to the Columns collection. Note This control can be used to display user input, which might include malicious client script. Note The GridView control can provide support for sorting, updating, and deleting with other types of data sources.
Note Inserting records into the data source is not directly supported by the GridView control. Note The GridView control is re-created on postback based on the information that is stored in ViewState.
Is this page helpful? Yes No. Any additional feedback? Skip Submit. Displays the value of a field in a data source. This is the default column type of the GridView control. Displays a command button for each item in the GridView control. This enables you to create a column of custom button controls, such as the Add or the Remove button. Displays a check box for each item in the GridView control. This column field type is commonly used to display fields with a Boolean value.
Displays the value of a field in a data source as a hyperlink. This column field type enables you to bind a second field to the hyperlink's URL.
Displays an image for each item in the GridView control. Displays user-defined content for each item in the GridView control according to a specified template. This column field type enables you to create a custom column field. The style settings for the alternating data rows in the GridView control. When this property is set, the data rows are displayed alternating between the RowStyle settings and the AlternatingRowStyle settings.
The style settings for the row being edited in the GridView control. The style settings for the empty data row displayed in the GridView control when the data source does not contain any records.
The style settings for the footer row of the GridView control. The style settings for the header row of the GridView control. The style settings for the pager row of the GridView control. The style settings for the data rows in the GridView control.
When the AlternatingRowStyle property is also set, the data rows are displayed alternating between the RowStyle settings and the AlternatingRowStyle settings.
The style settings for the selected row in the GridView control. The style setting for the data column the data is sorted by in the GridView control. When this style is set, the style for example, highlighted column is applied to cells when the data is sorted in ascending order. When this style is set, an arrow indicating the data is sorted ascending is placed on the header of the GridView control when the data is sorted in ascending order. When this style is set, the style for example, highlighted column is applied to cells when the data is sorted in descending order.
When this style is set, an arrow pointing down is placed on the header of the GridView when the data is sorted in descending order. Shows or hides the footer section of the GridView control. Shows or hides the header section of the GridView control.
This event is commonly used when you need to perform a task after the user navigates to a different page in the control.
This event is often used to cancel the paging operation. Occurs when a row's Cancel button is clicked, but before the GridView control exits edit mode.
This event is often used to stop the canceling operation. Occurs when a button is clicked in the GridView control. This event is often used to perform a task when a button is clicked in the control. Occurs when a new row is created in the GridView control.
This event is often used to modify the contents of a row when the row is created. Occurs when a data row is bound to data in the GridView control. This event is often used to modify the contents of a row when the row is bound to data.
Occurs when a row's Delete button is clicked, but after the GridView control deletes the record from the data source. GridView is most feature-rich control in ASP. Apart from displaying the data, you can perform select, sort, page, and edit operations with GridView control. Paging and sorting with GridView If your application is working with huge amount of data, then it is not good and efficient to display all records at a time.
Paging is a technique, which divides the records into pages. In DataGrid, the default page size is ten. The DataGrid supports two kinds of paging: 1. Default paging, and 2. Custom paging In default paging, the entire records are fetched from the database, then the DataGrid selects records from entire set of data, according to page size, to display it in DataGrid.
In custom paging, developers have to write code for selective retrieve of the records from entire records to display in each page. Interface Elements for Desktop. Interface Elements for Web. Dashboard for Desktop. Dashboard for Web. Download CHM. Grid View Jul 20, 8 minutes to read The GridView control allows you to display data from a data source in a grid. Features Data Binding The control works only in bound mode. Learn more See demo Unbound Columns The grid control supports unbound columns that are not bound to any data source field.
See demo Column Management The grid control displays data in a table format. Learn more See demo Move Columns The grid control supports drag-and-drop functionality that allows you to move a column to a different position. Learn more See demo Header and Data Cell Bands The grid control enables you to organize columns in logical groups bands and display them in multiple rows. See demo Data cell bands Columns allow you to display a data record hierarchically. See demo The grid allows you to group data by multiple columns at once and combine them into a single group MergeGroupsMode.
Learn more See demo Data Summary The grid allows you to display a brief description about groups of rows or individual data columns summaries in the footer ShowFooter. Learn more Master-Detail Grid The grid supports master-detail data. See demo Set the Mode property to EndlessPaging to enable endless paging mode, which enables you to load grid rows on demand when a user scrolls the grid.
See demo The grid supports virtual paging mode VerticalScrollBarStyle , which allows users to use the vertical scroll bar to navigate through grid pages. Learn more See demo Keyboard Navigation Built-in keyboard support allows you to use the keyboard to navigate the grid KeyboardSupport. Learn more See demo Focused Row You can focus a row in the grid.
Learn more See demo Adaptivity The grid allows you to build adaptive or responsive page layouts. NET Data Grid. Was this page helpful? Thanks for your feedback! Any other suggestions? Tell us here. Your feedback has been sent. No Your feedback is appreciated. We appreciate your feedback and continued support. Yes, I authorize DevExpress to contact me. Built-in row selection capabilities. Programmatic access to the GridView object model to dynamically set properties, handle events, and so on.
Multiple key fields. Multiple data fields for the hyperlink columns. Customizable appearance through themes and styles. In this we perform the following operations on GridView. ToList ; if service.
0コメント