sharma55 Ответов: 1

Проблема с выпадающим списком во вложенной сетке


I am implementing a nested grid view. I referred to below link for implementation

http://www.aspsnippets.com/Articles/ASPNet-Nested-GridViews-GridView-inside-GridView-with-Expand-and-Collapse-feature.aspx

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%>">
                              <ItemTemplate>
                                  <asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="true" UpdateMode="Conditional">
                                      <ContentTemplate>
                                          <asp:DropDownList ID="ddlAllocateDetails" runat="server" AutoPostBack="true" EnableViewState="true" Width="140px" OnSelectedIndexChanged="ddlAllocated_SelectedIndexChanged"></asp:DropDownList>
                                      </ContentTemplate>
                                      <Triggers>
                                          <asp:AsyncPostBackTrigger ControlID="ddlAllocateDetails" EventName="SelectedIndexChanged" />
                                      </Triggers>
                                  </asp:UpdatePanel>
                              </ItemTemplate>
                              <ItemStyle Width="140px" />
                          </asp:TemplateField>


Что я уже пробовал:

завернутый выпадающий список детей сетка в панель обновления с асинхронной обратной триггер

1 Ответов

Рейтинг:
2

sharma55

Я изменил реализацию, используя нижеприведенный пост. Это решило проблему.

Складной вложенный GridView с использованием подкачки ASP.Net[^]