Monday, October 31, 2011

Importance of NeedDataSource event

For advanced features such as Grouping, Sorting, Paging, RadGrid must be bound using declarative data sources or through the NeedDataSource event. When using declarative data sources or the NeedDataSource event, RadGrid can automatically accommodate the appropriate database operations without the need for you explicitly handle any sorting, paging, grouping, and so on.
Also note that you should never call the Rebind() method in a NeedDataSource event handler.You should never call DataBind() as well when using advanced data-binding through NeedDataSource.

2 comments:

  1. Rebind(), Is Not Sub Function, it is use to Call Need Data source, when ever you like,
    example :
    If You want To Perform Operation In Page Load Then You Must Use Rebind Before Performing any Operation In Rad Grid

    ReplyDelete
  2. Yes, Actually Rebind() function implicitly calls Need Data source event handler. So if you use Rebind() in NeedDataSource event it will stuck in loop forever.

    ReplyDelete