This is a migrated thread and some comments may be shown as answers.

RadGrid no more support the traditional DataBindprocess

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 19 Jan 2009, 05:50 PM
Hello,

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;
RadGrid.DataBind();

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 ?

Thanks

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 20 Jan 2009, 06:36 AM
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.

Thanks
Princy.

0
CSurieux
Top achievements
Rank 2
answered on 20 Jan 2009, 06:40 AM
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.

CS
Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
CSurieux
Top achievements
Rank 2
Share this question
or