Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0401cca

Browse files
fill readme
1 parent 709dc8e commit 0401cca

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎README.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Spreadsheet Document API: Bind a Worksheet to a Generic List or a BindingList Data Source
2+
3+
This example demonstrates the use of a [List\<T\>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1?view=net-7.0) and [BindingList\<T\>](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.bindinglist-1?view=net-7.0) objects as data sources to bind data to the worksheet range.
4+
5+
## Implementation Details
6+
7+
Use the [WorksheetDataBindingCollection.BindToDataSource](https://docs.devexpress.com/OfficeFileAPI/devexpress.spreadsheet.worksheetdatabindingcollection.bindtodatasource.overloads) method to bind data to the range, and the [WorksheetDataBindingCollection.BindTableToDataSource](https://docs.devexpress.com/OfficeFileAPI/devexpress.spreadsheet.worksheetdatabindingcollection.bindtabletodatasource.overloads) method to bind data to the worksheet table.
8+
9+
The [ExternalDataSourceOptions](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.ExternalDataSourceOptions) object specifies various data binding options. A custom converter with the [IBindingRangeValueConverter](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.IBindingRangeValueConverter) interface converts weather data between the data source and a worksheet.
10+
11+
If the data source does not allow modification, the binding worksheet range also prevents modification.
12+
13+
Data binding error results in the [WorksheetDataBinding.Error](https://docs.devexpress.com/OfficeFileAPI/DevExpress.Spreadsheet.WorksheetDataBindingCollection.Error) event and cancels data update. The event handler in this example displays a message containing the error type.
14+
15+
## Files to Review
16+
17+
* [Program.cs](./CS/SpreadsheetApiDataBinding/Program.cs) (VB: [Program.vb](./VB/DataBindingToSpreadsheetApiDataBindingListExample/Program.vb))
18+
* [MyConverter.cs](./CS/SpreadsheetApiDataBinding/MyConverter.cs) (VB: [MyConverter.vb](./VB/SpreadsheetApiDataBinding/MyConverter.vb))
19+
* [WeatherReport.cs](./CS/SpreadsheetApiDataBinding/WeatherReport.cs) (VB: [WeatherReport.vb](./VB/SpreadsheetApiDataBinding/WeatherReport.vb))
20+
21+
## Documentation
22+
23+
* [Spreadsheet Data Binding](https://docs.devexpress.com/OfficeFileAPI/118785/spreadsheet-document-api/data-binding)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /