Deepan Babu
Deepan Babu

Reputation: 515

How to Open a Popup on Devexpress Gridview CustomButton Click?

I have a Devexpress Gridview. I generated a GridViewCommandColumnCustomButton in that Gridview on server side.

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);

On that Custom button click, I need to open a popup either by devexpress popup control or any other means. Inside that popup control I need to load some controls dynamically.

How can I open popup on GridViewCommandColumnCustomButton click?

Upvotes: 0

Views: 13943

Answers (2)

Mikhail
Mikhail

Reputation: 9300

Perform the following steps to accomplish this task:

  • Handle the client-side CustomButtonClick event;

  • Show the ASPxPopupControl via the client-side Show method.

I usually use DevExpress Search service for such questions.

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

Upvotes: 2

Youp Bernoulli
Youp Bernoulli

Reputation: 5655

First you should attach an event handler to the custom button for the click event. Then in the click event you can go many ways. You can simply show some SuperToolTip from DevExpress when you only need to display data in some form or another. Not very familiar with ASP.NET, but I assume there are some nice alternatives out there to show pop-ups.

But first a Click event handler for the button ;)

Maybe this link might provide you with some more information.

Upvotes: 1

Related Questions