I need to use the click event of the PivotGrid and PivotFieldList buttons.

1 Answer 76 Views
PivotGrid and PivotFieldList
SANDRO
Top achievements
Rank 2
Iron
Iron
Iron
SANDRO asked on 17 Nov 2022, 10:39 PM

Hello,

I am working on the development of an application and I have some doubts in the handling of the PivotFieldList control.

I would like to know how to enter the onclick event of the "Update" button of the PivotFieldList, I want to place some validations when clicking on that button.

 

I would also like to know how to access the onclick event of the "OK" button that appears in each filter of the fields that are displayed in the PivotGrid, because I also want to add some validations when the button is clicked.

Thanks for the support.

1 Answer, 1 is accepted

Sort by
1
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 21 Nov 2022, 11:27 AM

Hello SANDRO,

Thank you for the provided images.

To subscribe to the Update button in the RadPivotFieldList you can use the following code:

var button = (this.radPivotFieldList1.Controls[0] as RadSplitContainer).Controls[1].Controls[1].Controls[1] as RadButton;
button.Click += Button_Click;

private void Button_Click(object sender, EventArgs e)
{
            
}

To subscribe to the Ok button in the filter popup you can use the following code:

this.radPivotGrid1.PivotGridElement.GroupDescriptorElementCreating += PivotGridElement_GroupDescriptorElementCreating;

private void PivotGridElement_GroupDescriptorElementCreating(object sender, GroupDescriptorElementCreatingEventArgs e)
{
    e.GroupDescriptorElement.FilterPopup.PopupOpened += FilterPopup_PopupOpened;
}

private void FilterPopup_PopupOpened(object sender, EventArgs args)
{
    PivotGroupFilterPopup filterPopup = (PivotGroupFilterPopup)sender;
    var okButton = filterPopup.Items.Last().Children[0].Children[0] as RadButtonElement;
    okButton.Click -= OkButton_Click;
    okButton.Click += OkButton_Click;     
            
}

private void OkButton_Click(object sender, EventArgs e)
{
            
}

I hope these solutions are what you are looking for.

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PivotGrid and PivotFieldList
Asked by
SANDRO
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or