Click here to Skip to main content
15,666,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am implementing a nested grid view. I referred to below link for implementation

I have a dropdown "Allocate" in the Parent grid and Child grid. The requirement is to remove the dropdown item if it is selected in any row. For that, I have selected index change event to have code piece where it removes the selected item and re-binds the dropdown in other rows. The issue is : Whenever the dropdown value is changed in the child, the grid collapses and hides child grid. To resolve this I wrapped dropdown list in child grid into update panel with async post back trigger so, that it can have partial post back. But, now it is not firing selected index change event. Please help to resolve the issue.

   A     | B   | C | Allocate
- Test   | 100 | 50 |          ----> Parent
  Test a | 50  | 25 | [Select] ------> Child
  Test b | 50  | 25 | [Select] ------> Child

+ Test1  | 50  | 25 |          ----> Parent

  Test 2 | 50  | 25 | [Select] ----> Parent with no child

<asp:TemplateField HeaderText="<%$ Resources:CIP,Label_Header_ddlAllocated%>">
                                  <asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="true" UpdateMode="Conditional">
                                          <asp:DropDownList ID="ddlAllocateDetails" runat="server" AutoPostBack="true" EnableViewState="true" Width="140px" OnSelectedIndexChanged="ddlAllocated_SelectedIndexChanged"></asp:DropDownList>
                                          <asp:AsyncPostBackTrigger ControlID="ddlAllocateDetails" EventName="SelectedIndexChanged" />
                              <ItemStyle Width="140px" />

What I have tried:

wrapped dropdown list in child grid into update panel with async post back trigger
Updated 11-Aug-16 10:25am

1 solution

I changed the implementation using below post. It resolved the issue.

Collapsible Nested GridView with Paging using ASP.Net[^]
Share this answer

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