how to set SfDataGrid print settings change event

Hi dears,

How can I call a method when user change print option in run time.

for example: I want to call "PrintSetting_Changed()" when user change PrintPageWith or PrinPageOreintation at run time.


1 Reply

VS Vijayarasan Sivanandham Syncfusion Team April 28, 2022 09:51 AM UTC

Hi Hossein Tavakoli,

Your requirement to set trigger the event while change print settings in SfDataGrid can be achieved by using the PropertyChanged event in SfDataGrid.PrintSettings.PrintManagerBase. Please refer the below code snippet,

datagrid.PrintSettings.PrintManagerBase.PropertyChanged += OnPropertyChanged;

private void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)

{

            MessageBox.Show("PrintSetting_Changed()");

} 

 
UG Link: https://help.syncfusion.com/wpf/datagrid/printing

Please find the sample in the attachment and let us know if you have any concerns in this.


Regards,

Vijayarasan S


Attachment: SfDataGridDemo_1ead8ecb.zip

Loader.
Up arrow icon