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

Template column not binding properly on client side binding for RadGrid

4 Answers 153 Views
Grid
This is a migrated thread and some comments may be shown as answers.
systems
Top achievements
Rank 1
systems asked on 04 Jul 2016, 08:15 AM

Hello,

We have a Rad grid with combination of Bound & Template columns in it.
For the first time when page gets loaded we are binding the Rad grid through server side Need Data Source handler.

In our case for page actions we are trying to bind the Rad grid from client side by calling Web Method via $.Ajax() function.

Everything works well w.r.t. Bound column but it seems Template column are not supported to bind data via client side.

We have tried many alternate ways to bind the template column at client side with no success. 

Could someone please advise is there a workaround/better way to achieve the client side binding of Template column for Rad Grid?

4 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 07 Jul 2016, 07:14 AM
Hi,

If you need to bind the grid on the client and use template columns you need to define ClientItemTemplate. Check out the following online example that illustrates how the functionality works:


With that said, I would recommend using only one approach for data-binding the RadGrid. Use either server- or client-side binding, however, mixing the different approaches can result in unexpected behavior.

Regards,
Viktor Tachev
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.
0
systems
Top achievements
Rank 1
answered on 11 Jul 2016, 07:47 AM

Hi Viktor, 

Thank you for your reply.

As per your suggestion I have used ClientItemTemplate.

But in our case were using some server controls such as 'RadToolTip, RadListBox, RadButton' in previously added Item Template. So for above scenario, how do we use  'RadToolTip, RadListBox, RadButton' in  ClientItemTemplate ?

Please provide any suggestion or any other way for above case?

Thanks in advance.

0
Viktor Tachev
Telerik team
answered on 13 Jul 2016, 01:46 PM
Hello,

The ClientItemTemplate is intended to be used when the RadGrid control is bound client-side. If you are using server controls with server-side binding you need to use ItemTemplate.

Moreover, if you would like to bind the grid on the client  you should also bind the other controls on the page client-side. In case you would like to use server-side binding you should bind all controls on the server.

Note that mixing server- and client-side data binding can produce unexpected results. Moreover, if a control on the page triggers a postback this would defeat the purpose of using client-side binding.

Regards,
Viktor Tachev
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.
0
systems
Top achievements
Rank 1
answered on 14 Jul 2016, 06:45 AM

Hi Viktor, 

Now, we understood and will go for Client Side binding.

Thank you for the help. 

 

 

Tags
Grid
Asked by
systems
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
systems
Top achievements
Rank 1
Share this question
or