GridView
is a server-side data representation control and it is 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 will give you a lot 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[^]