RadGrid no more support the traditional DataBindprocess

3 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 19 Jan 2009 Link to this post


    I spent hours on this problem !
    I am using radgrid in Ajaxifyed a RadTabStrip/Multipage with Edit/Delete columns using Imagebuttons.
    My page Load event was doing a
    RadGrid.dataSource    =    MyDataTable;

    With this I was getting as soon as clicking on an edit image an exception:
    "Invalid postback or callback argument", etc.

    I discovered that the DataBind was not necessary, and even worse: it was the cause of the crash.

    This has to be clearly stated in documentation, should I have missed it ?
    Could we have more explanation on this change and related RadGrid parameters usage ?

    When to use DataBind ? Is it nor more necessary ? I have dozen of DataBind in my code....

    What policy should we adopt ?

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 20 Jan 2009 Link to this post

    Hello Christian,

    I would suggest you to use AdvancedDataBinding Techniques which is way too convenient than Simple DataBinding .When using this technique unlike SimpleDatBinding , you need not explicitly bind the grid after every event or operation(RadGrid1.DataBind()), you just have to rebind the grid wherever necessary.
    In the code of the NeedDataSource handler you should prepare the data source (list of objects) for Telerik RadGrid and assign it to the grid's DataSource property.  Then after performing the required operations you can call the RadGrid1.Rebind() method which will automatically bind the grid to the datasource and vice versa.

    Note:  You should never call the DataBind() method from inside the NeedDataSource handler or mix simple data-binding mode with advanced data-binding.


  3. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 20 Jan 2009 Link to this post

    Hello Princy,

    Thanks for answer but I know all this, working since some time with your components.
    Problem here is that something is broken.
    DataSource/DataBind trigger a crash on cetain conditions easy to reproduce.
    It should not.

Back to Top