ASP.NET - How to bind() a dataset to a datagrid using javascript from the client

B

Brian Potroz

Hi Experts,


Can you please inform me how to bind() a dataset to a datagrid using
javascript from the client in ASP.NET ?

I have successfully returned / tested the dataset from the server (VB
codebehind) and have applied it to the datagrid.datasource as follows with
no errors.

'parent.document.stsFrme.document.all.DataGrid1.DataSource=response.value;'
(also using frames)

Can you please let me know how to bind this dataset to the datagrid. :)


Kind Regards...

Brian Potroz
 
B

Brian Potroz

Elyiyahu,


Thank you for your feedback regarding this issue.

I am using the Ajax.dll reference within my project to post a request from
the client to the server (obtaining the dataset) and again returning it back
to the client. Using javascript, I am then setting the datagrid.datasource
to my dataset (that works fine, no errors), if I can do that from the client
then I should be able to bind the datasource ?

Here is my javascript which sets the datasource of the datagrid from the
client:

'parent.document.stsFrme.document.all.DataGrid1.DataSource=response.value'


Kind Regards...

Brian
 
E

Eliyahu Goldin

Brian,

Client has no idea about what DataSource is. It doesn't know anything about
server side. All data source setting and databinding must be on server side.
What client can do is to pass to the server a parameter that the server will
take into account in its data setup operations.

Eliyahu
 
S

samuelrobertson

Hi,

If you want to do this you'll have to parse the datasource in
javascript somehow and add all the table elements using dynamic
javascript. In this case don't use a datagrid just use a placeholder
because when you build the table it won't function as a asp.net
datagrid anyway as the control ids won't be set propertly and you
didn't build the datagrid server side.

Basically the previous post is correct. You want to do something that
is impossible. The datagrid cannot be manipulated client side, except
possibly to read a few values from it, attach alerts to it, etc. I
would never think of *building* one client-side.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top