Telerik RadGrid is a component that visualizes data obtained from a database. The data is presented in tabular view.
There are three ways to bind the grid to a database:
- Using the data source controls introduced in ASP.NET 2.0 - codeless data-binding
- By using the NeedDataSource event - Telerik RadGrid will call this event each time it needs a data source.
- DataGrid like binding - You need to set the DataSource property manually in the control declaration. This property specifies the database, which will be used as a source for the grid.
When you create your grid and bind it to a data source, you can use one of the approaches described above.
Setting The DataSource object
When setting the DataSource property you should bear in mind the following notes:
|
DataSource property should refer to an object of one of the following types: |
|
System.Data.DataSet |
|
System.Data.DataTable |
|
System.Data.DataView |
|
DataSource property can refer also to an object-collection that implements any of these interfaces: |
|
System.ComponentModel.IListSource |
|
System.Collections.IList |
|
System.Collections.IEnumerable |
|
System.Collections.ICustomTypeDescriptor |