Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
1.11/5 (2 votes)
See more:
how to bind data in gridview using webservice in client side?
Posted
Updated 13-Jan-19 19:27pm
Comments
Sergey Alexandrovich Kryukov 9-May-12 1:50am    
Web Service? In client side? What it is supposed to mean? What is a client of what? :-)
--SA

GridView is a server-side data representation control and it recommended to bind it with data at the server. If you want to use GridView, you need to use transform the result from your webservice and convert it into a DataTable or a List type so you can bind them in your GridView. Here's an example on how to consume WebService in ASP.NET: Consuming Web Service In an ASP.Net Web Application[^]

Now, if you want to bind your GridView at the client using JavaScript/jQuery then GridView isn't the best control for you. While it could be possible, I'm pretty sure it give you a pain in the butt. What I'm trying to say is you must avoid mixing server side conntrols with client-side manipulation. Instead, use a client-side Grid that you can easily bind them at the client. One great example is using jQuery DataTable plugin: Display Data In ASP.NET Using jQuery DataTables Plugin[^]
 
Share this answer
 
Comments
CHill60 14-Jan-19 8:47am    
I'm guessing that Solution 3 resurrected this old post.
Vincent Maverick Durano 14-Jan-19 9:37am    
My bad. I missed the posted date again.
Here, have a look at the following:
WebService call[^]
PageMethod[^]

Once you receive back the response, set the grid data as it.
 
Share this answer
 
Simple and useful CodeProject article is available at Web Services, a simple approach[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900