.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Populating Gridview through AJAX

Posted By: nishithraj     Posted Date: November 26, 2009    Points:2   Category :ASP.Net
I'm having an issue with a scenario.
i.e, I have two grid views. In the page load I need to display the first one. While clicking any rows of that gridview, I need to hide it and display the second one(information related to the clicked row).

I need to do this without postbacking.
I tried with Iclientcallback and XMLHttprequest by calling from javascript. But the second grid is not populating. i.e it is not rendering properly. Eventhoug I rendered it manually. It is not displaying....

Any guess...

Responses
Author: Sudarshan             
Posted Date: November 26, 2009     Points: 5   

Did you mean nested gridview using Ajax in asp.net?

Sudarshan!

Author: nishithraj             
Posted Date: November 26, 2009     Points: 5   

Not a nested one. Two seperate grids in a same page needs to populate without refreshing the page as follows.

by default -- one grid
if we click on this grid 2nd grid needs to be displayed first one should be hided.

Author: Sudarshan             
Posted Date: November 26, 2009     Points: 5   

Good Afternoon Nishithraj,

You can place the both gridview inside update panel and you can hide the 1st one once the 2nd gridview is set to visible true.

Thanks

Author: nishithraj             
Posted Date: November 26, 2009     Points: 5   

I tried this. But the scenario is like I need to take the clicked row id from first grid and need to generate the second grid with the details of this id.

So tried to do with XMLHttphandler also IClientCallback to call the second grid binding method from the clientside. It's calling the method. But the second grid is not rendering properly.

Author: Sudarshan             
Posted Date: November 26, 2009     Points: 5   

Hi Nishithraj,

I dont think you need XMLHttphandler or IClientCallback you can poplulate the 2nd gridview by clicking on the controls in the 1st gridvoew.. Just you need to make sure that you have not set the EnableViewState of the page or gridview to false.

Author: nishithraj             
Posted Date: November 26, 2009     Points: 5   

Right now it works like this.

There are two grids Say A and B.

First time A binds and shows to the users. If user clicks a row on A. I'll do a post back to the page to bind the grid B by sending the id of the clicked row of A. Also making the display of A as none.

So it's doing a post back. Same scenario I need to do without a post back.



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend