Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<!-- default badges list -->
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128577281/22.1.2%2B)
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/E2986)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
<!-- default badges end -->
<!-- default file list -->
*Files to look at*:
# Pivot Grid for Web Forms - How to create and bind Pivot Grid to data in code

* [Default.aspx](./CS/ASPxPivotGrid_RuntimeDataBinding/Default.aspx) (VB: [Default.aspx](./VB/ASPxPivotGrid_RuntimeDataBinding/Default.aspx))
* [Default.aspx.cs](./CS/ASPxPivotGrid_RuntimeDataBinding/Default.aspx.cs) (VB: [Default.aspx.vb](./VB/ASPxPivotGrid_RuntimeDataBinding/Default.aspx.vb))
<!-- default file list end -->
# How to create and bind Pivot Grid to data in code
<!-- run online -->
**[[Run Online]](https://codecentral.devexpress.com/e2986/)**
<!-- run online end -->
This example demonstrates how to create a Pivot Grid and bind it to data via code.

In this example, the [ASPxPivotGrid](https://docs.devexpress.com/AspNet/DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid) and SqlDataSource instances are created and initialized in code. The Pivot Grid is bound to data by assigning the SqlDataSource instance to the [ASPxPivotGrid.DataSource](https://docs.devexpress.com/AspNet/DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid.DataSource) property. Then call the [ASPxPivotGrid.RetrieveFields](https://docs.devexpress.com/AspNet/DevExpress.Web.ASPxPivotGrid.ASPxPivotGrid.RetrieveFields.overloads) method to generate [DataSourceColumnBinding](https://docs.devexpress.com/AspNet/DevExpress.Web.ASPxPivotGrid.DataSourceColumnBinding?v=22.1) objects for each Pivot Grid field.

## Files to Look At

- [Default.aspx](./CS/ASPxPivotGrid_RuntimeDataBinding/Default.aspx) (VB: [Default.aspx](./VB/ASPxPivotGrid_RuntimeDataBinding/Default.aspx))
- [Default.aspx.cs](./CS/ASPxPivotGrid_RuntimeDataBinding/Default.aspx.cs) (VB: [Default.aspx.vb](./VB/ASPxPivotGrid_RuntimeDataBinding/Default.aspx.vb))

## Documentation

- [Binding to Data in Pivot Grid](https://docs.devexpress.com/AspNet/7258/components/pivot-grid/binding-to-data/binding-to-data-overview?p=netframework#code)

<p>This example demonstrates how to create an ASPxPivotGrid and bind it to data via code.</p><p>In this example, the ASPxPivotGrid and AccessDataSource instances are created and initialized in code. The Pivot Grid is bound to data by assigning the AccessDataSource instance to the ASPxPivotGrid.DataSource property. Then the ASPxPivotGrid.RetrieveFields method is used to create pivot grid fields for all data source fields.</p>

<br/>


4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"runOnWeb": true,
"runOnWeb": false,
"autoGenerateVb": true
}
}