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

RadGrid NeedDataSource not executing on postback

1 Answer 179 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Johney
Top achievements
Rank 1
Johney asked on 07 Sep 2016, 02:40 PM

Hello I am having one issue on RadGrid. I have a simple Employee list which I am binding in Page_Load inside !IsPostBack check.

As soon as, a postback happens (whether it is due to a button click or due to allowsorting (automatic sort)); the grid disappears. This is because NeedDataSource is not executed on postback.

However, if I write RadGrid1.Rebind() then NeedDataSource is executed.

Does this means everytime when a postback happens, I have to call RadGrid1.Rebind() to bind the grid (whether it is due to a button click or due to allowsorting (automatic sort))?

I remember in earlier version we did not needed to call Rebind() method to make NeedDataSource execute.

Please help.

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 10 Sep 2016, 01:29 PM
Hello Johney,

When using advanced data binding through NeedDataSource you do not need to bind the grid initially on Page_Load event handler. I would recommend you to check out the following help article which elaborates more on this binding type.

Regards,
Kostadin
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Johney
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or