Simple data-binding through the
DataBind() method can be used in simple scenarios which
does not require complex operations like insert/delete/update, grouping, hierarchy relations,
etc. For advanced features like grouping, hierarchy presentation, filtering. etc. Telerik RadGrid requires advanced data-binding through its
NeedDataSource event or
data source control (see the
NeedDataSource demo in this section
or the
Automatic operations demo from the
Insert/Update/Delete section of the
QSF).
The
NeedDataSource event is especially designed to facilitate the work of the developers
as you do not need to handle any sorting/paging/grouping/filtering/etc. commands manually.
Under such circumstances Telerik RadGrid will be "smart enough" to perform the corresponding
operation automatically.
This example demonstrates how the use Telerik RadGrid with simple data binding. You should:
- Set the DataSource property. This property points the database which will be used
as a source for your grid instance.
- Call the DataBind() method when appropriate.
The correct approach when using simple data-binding is to call the
DataBind() method
on the first page load when
!Page.IsPostBack and after handling some event
(sort event for example).
Keep in mind that if you choose simple data-binding, you will need to assign data-source and
rebind the grid after each operation (paging, sorting, editing, etc.) - this copies exactly
MS
DataGrid behavior.
For additional information you can review this online resource:
Simple data binding