Load Event on Nested Data Grid

Results 1 to 5 of 5

Thread: Load Event on Nested Data Grid

  1. #1
    Join Date
    Dec 1969
    Posts
    20

    Default Load Event on Nested Data Grid

    I have a DataGrid that contains a nested DataGrid inside of it. This gives me a MasterGrid / DetailGrid view of my data. I databind the DetailGrid using its Load event. This works great when the item first loads but when I click a page number on the MasterGrid, I get the following events:<BR>First the Load event fires on the DetailGrid - after inspecting this event, the MasterGrid (or sender.NabingContainer) is unbound. Then I get the PageIndexChanged event. That is where I bind some new data to my Master Grid and reset the CurrentPageIndex. Finally I get another Load event on my DetailGrid. Why would I get two Load events on my Detail grid?<BR><BR>Is this the proper way to nest datagrids? Any other ideas on how to build a Master / Detail relationship would help - I want to do Paging on the MasterGrid and sorting on the Detail grid. That is where the difficulty started.<BR><BR>I have a hack way of fixing the problem. I just don&#039;t databind the DetailsGrid if its load event tells me that the MasterGrid is currently not bound to any data. That seems like a HAck to me only because I cannot understand where the second Load event comes from.

  2. #2
    Join Date
    Dec 1969
    Posts
    112

    Default RE: Load Event on Nested Data Grid

    I tried to nest a datagrid within another once, too, and like you I got a bad result. I figured it couldn&#039;t be done. Please post if you get it to render. Wish I could help you.

  3. #3
    Join Date
    Dec 1969
    Posts
    20

    Default I WILL POST MY CODE WHEN DONE!

    Since the purpose of this nested datagrid is for a Code Example and to help me learn C# and ASP.NET better - I will be sure to post the code when I am done!

  4. #4
    Join Date
    Dec 1969
    Posts
    234

    Default RE: Load Event on Nested Data Grid

    Hi David,<BR><BR>Here are some URLs on Master-Detail DataGrids to follow up:<BR><BR>http://www.devdays.com.ar/Info/Tecnologias/ASP/Creating%20a%20Master-Detail%20View%20Using%20the%20ASP+%20DataGrid%20Co ntrol.htm <BR><BR>http://www.c-sharpcorner.com/asp/Articles/MasterDetailDCHK.asp <BR><BR>http://www.dotnetjunkies.com/tutorials.aspx?tutorialid=135 <BR><BR>http://www.aspalliance.com/aldotnet/examples/masterdetail_ddl_datagrid.aspx <BR><BR>Hope they help,<BR><BR>JON


  5. #5
    Join Date
    Dec 1969
    Posts
    20

    Default RE: Load Event on Nested Data Grid

    I have seen a few of those samples - but not all of them! I do, however, plan on allowing paging and sorting on both the master and the detail data-grids and that is where it gets real tricky! The second complexity I have is that I will be showing a Detail grid per-row in the master grid. I will certainly inspect the new samples you have given.<BR><BR>Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •