ASPxPopupControl does not show up in the right place
Posted on 2011-02-25 12:52 sunrack 阅读(606) 评论(0) 编辑 收藏 举报Created by Haithem at 2010/6/4 23:28:11
Attachment: Project.rar (27522 bytes)
Hi there,
I am trying to follow your example, so i can warn the user for some requirement
http://demos.devexpress.com/ASPxperienceDemos/PopupControl/ClientSideAPI.aspx
I have attached a test project, in which i have the aspxtextbox within an aspxnavbar. My issue is the aspxpopcontrol does not show near by the appropriate element. Could you check what i am doing wrong here.
Thank you for your help
Reviewed by DevExpress Team at 2010/6/5 1:45:51
Processed (Answered) by DevExpress Team at 2010/6/7 11:53:22
Attachment: Project_Q261869.zip (32759 bytes)
Hello Mohamed Haithem,
I'd like to note that the PopupWindow.PopupElementID property requires a Control.UniqueID. However, if a control resides in a naming container (ASPxNavBar in your situation, or similar), then its Control.UniqueID doesn't equal Control.ID and Control.ClientInstanceName. In your case, the ASPxTextBox.UniqueID is formed dynamically.
As a solution, I suggest that you set the PopupElementID property at runtime. For example:
[C#]
protected void Page_Load(object sender, EventArgs e) {
ASPxTextBox txt1 = ASPxNavBar1.Groups[0].FindControl("text1") as ASPxTextBox;
pcErrorW.Windows[0].PopupElementID = txt1.UniqueID;
ASPxTextBox txt2 = ASPxNavBar1.Groups[1].FindControl("text2") as ASPxTextBox;
pcErrorW.Windows[1].PopupElementID = txt2.UniqueID;
}
I've modified your project accordingly. Please check it, and let me know the result.
Thanks,
Marion
protected void Page_Load(object sender, EventArgs e) {
ASPxTextBox txt1 = ASPxNavBar1.Groups[0].FindControl("text1") as ASPxTextBox;
pcErrorW.Windows[0].PopupElementID = txt1.UniqueID;
ASPxTextBox txt2 = ASPxNavBar1.Groups[1].FindControl("text2") as ASPxTextBox;
pcErrorW.Windows[1].PopupElementID = txt2.UniqueID;
}