Hi I'm trying to figure out how to get a messagebox or dialog to popup which I click on a cell in my gridview. Inside the popup will be 3 radiobutton to change which is what will determine what is show in that cell and a save button to save the change. I've been looking online, and I came across a recommendation to use user control. I've created a user control with the layout done, but I'm not sure how to bind it to cell on my gridview and how to control the function of the clicks inside the user control. I've attached what I would like it to look like below:
4 Answers, 1 is accepted
According to the provided information I suppose that the following KB article will fit perfectly to your scenario: https://www.telerik.com/support/kb/winforms/gridview/details/create-pop-up-user-control-for-row-editing
You can use a similar approach for achieving your goal.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
So in this example, its telling me to use a RadDropDownButton. If I want to have it popup when I click the already gridview existing process row cell or the text in that cell. What do I need to replace the RadDropDownButton part below with? My column for the the process column was created thru the PropertyBuilder with data source to the table view in my sql server as GridViewTextBoxColumn.
Their example:
protected override void CreateChildElements()
{
base.CreateChildElements();
this.button = new RadDropDownButtonElement();
this.button.Text = "Click For Edit";
this.Children.Add(button);
this.button.Items.Add(CreateDropDownButton());
//subscribe for RadDropDownButtonClick event
this.button.Click += new EventHandler(button_Click);
//subscribe for UserControl's saveButton click event
RadButton saveButton = (RadButton)userControl.Controls["saveButton"];
saveButton.Click += new EventHandler(saveButton_Click);
}
Oops...
missed some...
Their example should be:
public class CustomCell : GridDataCellElement
{
private RadDropDownButtonElement button;
private UserControl1 userControl;
public CustomCell(GridViewColumn column, GridRowElement row) : base(column, row)
{
}
protected override void CreateChildElements()
{
base.CreateChildElements();
this.button = new RadDropDownButtonElement();
this.button.Text = "Click For Edit";
this.Children.Add(button);
this.button.Items.Add(CreateDropDownButton());
//subscribe for RadDropDownButtonClick event
this.button.Click += new EventHandler(button_Click);
//subscribe for UserControl's saveButton click event
RadButton saveButton = (RadButton)userControl.Controls["saveButton"];
saveButton.Click += new EventHandler(saveButton_Click);
}
The provided approach uses a custom GridDataCellElement which is created in the RadGridView.CreateCell event. You can subscribe to this event at design time as well via the Properties section in Visual Studio. Otherwise, you can add the column programatically at run time after subscribing t the event.
If you are still experiencing any further difficulties, feel free to submit a support ticket from your Telerik account and provide a sample project demonstrating the undesired behavior that you are facing. Thus, our support staff would be able to further investigate the precise case and gladly assist you.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Should you have further questions please let me know.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik