Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am showing some records in a left to right position with a scroll.

but i have button above "Switch to grid view" and i want to show the records in a grid view on clicking this button.

i am using XMLHTTPREQUEST.

when i click the button and assign a data source to the grid view in the server side function using XMLHTTPREQUEST. it does not work..

any solution for this problem?


Thanks.
Posted
Updated 13-Jan-11 18:42pm
v3
Comments
Kasson 14-Jan-11 0:25am    
What error it shows?
York129 14-Jan-11 1:06am    
no error is showed.

but it does not show the records in grid view.

1 solution

when i click the button and assign a data source to the grid view in the server side function using XMLHTTPREQUEST. it does not work..
This is not how XmlHttpRequest work! If you use it display something, then you need to return some response back to client from server - catch it and then modify the control content with it.

What you are trying would work in case of ASP.NET AJAX (i.e. with Script manager & Update Panel).

Resolution:
Instead of just assigning the grid source on server, get back the new grid xml on client side and assign that to the grid via Javascript to see the change.
Thus steps after XMLHttpRequest sent:
1. Generate the new html of the new data bound to grid
2. Send that back to client side
3. Use the recieved html to fill in the grid container.

Now, I know this is not the first time you are asking this question. I am not posting any XMLHttpRequest links because that has already been shared with you.
I told you the concept now. Just try to put it in the XMLHttpRequest implementation.
 
Share this answer
 
v2
Comments
York129 14-Jan-11 1:11am    
I posted it twice because i want others to answer this.
Sandeep Mewara 14-Jan-11 1:35am    
In order to get answers from others, you dont need to repost it!

You can edit your old question and that will bring your question to top of the question stack - if others find it necessary or feel like then they will surely answer.

Just a suggestion to you as re-post is considered rude, rest your wish.

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