ASPxPopup no se actualiza en ASPxGridView La selección cambió

I have an ASPxPopupControl and an ASPxGridView. Inside this PopupControl i have my own usercontrol which contains a form for editing person information. Inside the GridView is a list with different persons. When i select a different person in the gridview i want the content of the popupcontrol to update for the to the person information of the selected user so i can edit it.

My problem is; i can't get this to work, i have tried placing update panels with all sorts of triggers or forcing the updatepanel to update. But it still doesn't work.

PopupControl:

<dx:ASPxPopupControl ID="pcVolgnummerToevoegen" runat="server" AllowDragging="True" ClientInstanceName="popup_toevoegen" CloseAction="CloseButton" LoadingPanelText="Laden&amp;hellip;" Height="700" Width="700" Modal="True" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
<ContentCollection>
<dx:PopupControlContentControl ID="pcVolgnummerToevoegenContent" runat="server">
  <asp:UpdatePanel ID="upnlToevoegen" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
      <uc:GegevensControl ID="ucGegevensControl_Toevoegen" runat="server" />
    </ContentTemplate>
    <Triggers>
      <asp:AsyncPostBackTrigger ControlID="KlantVolgnummerGrid" />
    </Triggers>
  </asp:UpdatePanel>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:ASPxPopupControl>

DataView Selection_Changed:

protected void KlantVolgnummerGrid_SelectionChanged(object sender, EventArgs e)
{
  Session["Person_Id"] = KlantVolgnummerGrid.GetSelectedFieldValues("ID");
}

Page_Load of the usercontrol inside the popup

protected void Page_Load(object sender, EventArgs e)
{
 Person varPerson = PersonControllerClient.GetPerson(Session["Person_Id"]);
 ....Code that fills the form
}

I have checked the SelectionChanged event of the GridView, it triggers. But the update panel doesn't update. After i refresh the page the person i have selected is shown inside the popup.

Is there anyway i can update the popup for showing the right person without having to refresh the page everytime i select a different person?

preguntado el 09 de noviembre de 11 a las 10:11

2 Respuestas

Disable a ASPxGridView callback mode to force grid using UpdatePanel callbacks.

Simplemente configure ASPxGridView.EnableCallBack http://documentation.devexpress.com/#AspNet/DevExpressWebASPxGridViewASPxGridView_EnableCallBackstopic propiedad a "falso".

respondido 10 nov., 11:15

Remove the trigger and add ChildrenAsTriggers="false" on your updatepanel

  <asp:UpdatePanel ID="upnlToevoegen" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
    <ContentTemplate>
      <uc:GegevensControl ID="ucGegevensControl_Toevoegen" runat="server" />
    </ContentTemplate>
  </asp:UpdatePanel>

código detrás:

protected void KlantVolgnummerGrid_SelectionChanged(object sender, EventArgs e)
{
  int id = KlantVolgnummerGrid.GetSelectedFieldValues("ID");
  Person varPerson = PersonControllerClient.GetPerson(id);
  ....Code that fills the form

  upnlToevoegen.Update();
}

respondido 10 nov., 11:04

Thanks for your help, but this didn't work, already tried it multiple times, now tried it again, but didn't work. - Pedryk

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.