This example demonstrates how to select a worksheet range and use it as a data source for Linear Gauge and Data Grid controls.
Select the range containing data and click Provide Data to Gauge. The data source is created and passed to all data-aware controls. Switch to the Thermometer tab to see the linear gauge and a grid controls bound to the worksheet range.
The Range.GetDataSource method call creates the data binding range. The RangeDataSourceOptions.UseFirstRowAsHeader option allows you to automatically name columns in the data source. The DataSourceColumnTypeDetector option is used to specify a custom object that provides column names and determines column types. The DataBindingCollection.Error event is handled to obtain additional information if any error occurs during data binding.
- Form1.cs (VB: Form1.vb)
- MyColumnDetector.cs (VB: MyColumnDetector.vb)