2012-01-30 123 views
0

我有一个Devexpress Gridview。我在服务器端的Gridview中生成了一个GridViewCommandColumnCustomButton如何在Devexpress Gridview CustomButton上打开弹出窗口单击?

GridViewCommandColumn coldescriptor = new GridViewCommandColumn();            
GridViewCommandColumnCustomButton CusButton = new GridViewCommandColumnCustomButton(); 
CusButton.ID = "btnPopup"; 
coldescriptor.VisibleIndex = 2; 
CusButton.Image.Url = "~/Images/color2.jpg"; 
coldescriptor.ButtonType = ButtonType.Image;       
coldescriptor.CustomButtons.Add(CusButton); 
ggc_preview.Columns.Add(coldescriptor); 

在那个自定义按钮点击,我需要无论是DevExpress的弹出控制或其他任何方式打开一个弹出。 在弹出窗口控件中,我需要动态加载一些控件。

如何打开GridViewCommandColumnCustomButton点击的弹出窗口?

回答

2

执行以下步骤来完成此任务:

  • 处理客户端CustomButtonClick事件;

  • 通过客户端Show方法显示ASPxPopupControl。

我通常使用DevExpress Search service这样的问题。

ggc_preview.ClientSideEvents.CustomButtonClick = string.Format("function(s, e) {{ if(e.buttonID = 'btnPopup') {0}.Show(); }}", ASPxPopupControl_ClientInstanceName_Here); 
+0

嗨,当我点击自定义按钮,我想处理弹出控件绑定数据在服务器端。你有什么建议吗? – altandogan 2013-02-21 09:04:49

+0

我建议你联系DevExpress支持。 – Mikhail 2013-02-21 19:55:56

1

首先,您应该将事件处理程序附加到click事件的自定义按钮。然后在点击事件中,您可以采取多种方式。当您只需要以某种形式或其他形式显示数据时,您可以直接在DevExpress上显示一些SuperToolTip。不太熟悉ASP.NET,但我认为有一些不错的选择可以显示弹出窗口。

但首先该按钮Click事件处理程序;)

Maybe this link might provide you with some more information

+0

我已经为此自定义按钮添加了一个callbackevent,但是如何打开该事件内的弹出窗口。 '' – 2012-01-30 09:12:07

+0

也许在这里:http://www.google.com/search?q=asp.net+show+popup – 2012-01-30 10:33:46

相关问题