ActiveReports Developer 7
Cancel Property
See Also  Example
GrapeCity.ActiveReports.Design.Win.v7 Assembly > GrapeCity.ActiveReports.Design Namespace > DataSourceIconClickEventArgs Class : Cancel Property

Glossary Item Box

Determines whether the default DataSource dialog is displayed. If the value is set to True, the DataSource dialog will not open when the DataSource Icon is clicked in the End-User Designer.

Syntax

Visual Basic (Declaration) 
Public Property Cancel As System.Boolean
C# 
public System.bool Cancel {get; set;}

Remarks

For End-User Designer only. The DataSourceClick event must be attached to the Designer in order for this to take effect. If the value is set to True, the default Datasource dialog will not open when the Datasource Icon is clicked in End-User Designer. In a typical scenario a custom dialog can be showed instead.

Example

C#Copy Code
//Create the DataSourceClick event handler  
this.arDesigner.DataSourceIconClick += new DataSourceIconClickEventHandler(arDesigner_DataSourceIconClick);  
  
//Create the event handling method to respond to the user clicking the Datasource Icon  
//Set Cancel to True to stop the default Datasource dialog from showing  
private void arDesigner_DataSourceIconClick(object sender, DataSourceIconClickArgs e)  
{  
    e.Cancel = true;  
  
    Form f = new Form();  
    f.ShowDialog(this);  
  
    // Add custom code to modify the report data source based on user preference  
}
Visual BasicCopy Code
'Create the DataSourceClick event handler
Me.arDesigner.DataSourceIconClick += New DataSourceIconClickEventHandler(arDesigner_DataSourceIconClick)

'Create the event handling method to respond to the user clicking the Datasource Icon
'Set Cancel to True to stop the default Datasource dialog from showi
Private Sub arDesigner_DataSourceIconClick(ByVal sender As Object, ByVal e As DataSourceIconClickArgs)
    e.Cancel = True

    Dim f As Form = New Form()
    f.ShowDialog(Me)

    ' Add custom code to modify the report data source based on user preference
End Sub

See Also