C#-DevExpress-How to get value from the control inside DropDownWindowTemplate

ASPxDropDownEdit - How to get value from the control inside DropDownWindowTemplate

Tags:

Juan C. Silva Yepes7 years ago

    • Hello,

      How can get a value of the DropDownWindowTemplate of the ASPxDropDownEdit Control.
      The control into DropDownWindowTemplate is a ASPxMemo.
      Thanks,
      Juan Carlos Silva Yepes

  •  
  • Mike (DevExpress Support)7 years ago

    Hello,
    Would you please clarify some extra information about your scenario?
    - Where (on the server side or client side) do you want to perform this operation?
    - Provide me with the markup and code of the mentioned ASPxDropDownEdit control and its template.
    This information will allow me to provide you with a precise solution.

  • Juan C. Silva Yepes7 years ago

    Hello Mike,
    Here attached test project and a video which shows the case discussed.
    Thanks,
    Juan Carlos Silva Yepes

    DropDownTemplate.rar

Leave a Comment

1 Solution

 

Larry (DevExpress Support)7 years ago

​​​​​​​

Hello Juan Carlos,
Thank you for providing your project. When you are using the ASPxDropDownEdit, it is necessary to synchronize values of the editors inside DropDownWindowTemplate with the ASPxDropDownEdit's value. You can implement this by using the following code:


 

[ASPx]

<dx:ASPxDropDownEdit ID="ASPxDropDownEdit1" runat="server" ReadOnly="true" ClientInstanceName="dde"> <DropDownWindowTemplate> <dx:ASPxMemo ID="ASPxMemo1" runat="server" Height="71px" Width="170px"> <ClientSideEvents TextChanged="function(s, e) { dde.SetText(s.GetText()); }" /> </dx:ASPxMemo> </DropDownWindowTemplate> </dx:ASPxDropDownEdit>

This way, you can get the ASPxDropDownEdit's value either on the server or client side. In addition, if you want to get a reference to the controls inside DropDownWindowTemplate, use the ASPxDropDownEdit.FindControl method:

[C#]

ASPxMemo memo = ASPxDropDownEdit1.FindControl("ASPxMemo1") as ASPxMemo;

Attached is the modified project. Please let me know if you need further assistance.

posted @ 2019-10-04 17:24  grj001  阅读(64)  评论(0编辑  收藏  举报