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

本文介绍如何在ASPxDropDownEdit控件中使用DropDownWindowTemplate,并通过示例代码展示了如何将模板内的ASPxMemo控件的值与ASPxDropDownEdit的值进行同步。此外,还提供了获取模板内控件引用的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值