I am using wcf service to bind rad grid(Q1 2009) via client. I am using item template column and when I change page size, I need to bind grid server side(because when I change page size just data retrieve and template column can't load).
anyone help me?
thank.
anyone help me?
thank.
6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 10 Aug 2009, 08:38 AM
Hi,
I have found the following blog post which explains how to bind RadGrid using WCF. Go through it and see if it helps.
RadGrid for ASP.NET AJAX client-side data-binding to WCF
Princy
I have found the following blog post which explains how to bind RadGrid using WCF. Go through it and see if it helps.
RadGrid for ASP.NET AJAX client-side data-binding to WCF
Princy
0
Mojtaba
Top achievements
Rank 1
answered on 10 Aug 2009, 10:01 AM
Hi Princy,
Thank you for your attention, but that example was simple WCF binding via client.
My question is, how can bind grid server side alternatively with WCF service?
Thank.
Thank you for your attention, but that example was simple WCF binding via client.
My question is, how can bind grid server side alternatively with WCF service?
Thank.
0
Hi Mojtaba,
Please, review the following discussion on the topic that explains what the possible way are when using client-side databinding and GridTemplateColumns: (here).
As for mixing the two binding modes, you can certainly do that, but the details on how to achieve it depend on your particular implementation. For example, in the client javascript function where you call the WCF service to bind the grid, you can conditionally call the WCF service, or alternatively make an ajax request (through the RadAjaxManager control) on the server where you can bind the grid.
I hope this helps.
Best Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Please, review the following discussion on the topic that explains what the possible way are when using client-side databinding and GridTemplateColumns: (here).
As for mixing the two binding modes, you can certainly do that, but the details on how to achieve it depend on your particular implementation. For example, in the client javascript function where you call the WCF service to bind the grid, you can conditionally call the WCF service, or alternatively make an ajax request (through the RadAjaxManager control) on the server where you can bind the grid.
I hope this helps.
Best Regards,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mojtaba
Top achievements
Rank 1
answered on 13 Aug 2009, 12:09 PM
Hi Tsvetoslav ,
My implementation is similar to "RadGrid bound to WCF Web Service" in this demo http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx. Is there any way for me to rebind grid server side alternatively?
Thanks.
My implementation is similar to "RadGrid bound to WCF Web Service" in this demo http://demos.telerik.com/aspnet-ajax/grid/examples/clientbinding/defaultcs.aspx. Is there any way for me to rebind grid server side alternatively?
Thanks.
0
Mojtaba
Top achievements
Rank 1
answered on 15 Aug 2009, 01:27 PM
Isn't there any answers?
0
Hi Mojtaba,
Here are some general directions on how to achieve your scenario:
1. Add a RadAjaxManager control to your page.
2. Add to it the following AjaxSetting:
3. Attach an event handler to the client OnDataBinding event of the grid.
4. In the javascript handler method, cancel the event upon your business logic and make an ajax request through the ajax manager control:
5. Attach an event handler to the ajax manager's server AjaxRequest event.
6. In the event handler, rebind the grid:
I hope this information helps.
Greetings,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Here are some general directions on how to achieve your scenario:
1. Add a RadAjaxManager control to your page.
2. Add to it the following AjaxSetting:
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
3. Attach an event handler to the client OnDataBinding event of the grid.
| <ClientSettings> |
| <DataBinding... /> |
| <ClientEvents OnDataBinding="RadGrid1_DataBinding" /> |
| </ClientSettings> |
4. In the javascript handler method, cancel the event upon your business logic and make an ajax request through the ajax manager control:
| function RadGrid1_DataBinding(sender, args) |
| { |
| if (/*your business logic goes here*/) |
| { |
| args.set_cancel(true); |
| var ajaxManager = $find('<%=RadAjaxManager1.ClientID%>'); |
| ajaxManager.ajaxRequest(); |
| } |
| } |
5. Attach an event handler to the ajax manager's server AjaxRequest event.
6. In the event handler, rebind the grid:
| protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) |
| { |
| RadGrid1.DataSource = /*your data goes here*/; |
| RadGrid1.Rebind(); |
| } |
I hope this information helps.
Greetings,
Tsvetoslav
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.