예제 #1
0
 private void XtraReport_FilterComponentProperties(object sender, FilterComponentPropertiesEventArgs e)
 {
     // The following code hides some properties for a specific report element.
     if (sender is XtraReport1 && e.Component is XRControl)
     {
         HideProperty("Text", e);
         HideProperty("DataBindings", e);
     }
 }
 private static void FilterComponentProperties(object sender, FilterComponentPropertiesEventArgs e)
 {
     // The following code hides some properties for a specific report element.
     if (!(sender is XtraReport && e.Component is XtraReport))
     {
         return;
     }
     //HideProperty("Tag", e);
 }
예제 #3
0
        private void XtraReport_FilterComponentProperties(object sender, FilterComponentPropertiesEventArgs e)
        {
            PropertyDescriptor propertyDescriptor1 = e.Properties["PaperKind"] as PropertyDescriptor;

            if (propertyDescriptor1 != null)
            {
                List <Attribute> attributes = new List <Attribute>(propertyDescriptor1.Attributes.Cast <Attribute>().Where(att => !(att is PropertyGridTabAttribute)));
                attributes.Add(new PropertyGridTabAttribute("My tab"));
                e.Properties["PaperKind"] = TypeDescriptor.CreateProperty(
                    propertyDescriptor1.ComponentType,
                    propertyDescriptor1,
                    attributes.ToArray());
            }
        }
        static void XtraReport_FilterComponentProperties(object sender, FilterComponentPropertiesEventArgs e)
        {
            // Hide the Scripts property for all report elements.
            HideProperty("Scripts", e);

            // Hide the ReportSource and ReportSourceUrl properties for subreports.
            if (e.Component is XRSubreport)
            {
                HideProperty("ReportSource", e);
                HideProperty("ReportSourceUrl", e);
            }

            // Hide the Name property for XRLabel controls.
            if (e.Component is XRLabel)
            {
                HideProperty("Name", e);
            }
        }
        static void XtraReport_FilterComponentProperties(object sender,
                                                         FilterComponentPropertiesEventArgs e)
        {
            // Hide the Scripts property for all report elements.
            HideProperty("Scripts", e);

            // Hide the ReportSource and ReportSourceUrl properties for subreports.
            if (e.Component is XRSubreport)
            {
                HideProperty("ReportSource", e);
                HideProperty("ReportSourceUrl", e);
            }

            // Hide the Name property for a specific label control.
            if (sender is XtraReport1 && e.Component is XRControl &&
                ((XRControl)e.Component).Name == "label1")
            {
                HideProperty("Name", e);
            }
        }
        private static void HideProperty(String propertyName, FilterComponentPropertiesEventArgs e)
        {
            var oldPropertyDescriptor = e.Properties[propertyName] as PropertyDescriptor;

            if (oldPropertyDescriptor != null)
            {
                // Substitute the current property descriptor
                // with a custom one with the BrowsableAttribute.No attribute.
                e.Properties[propertyName] = TypeDescriptor.CreateProperty(
                    oldPropertyDescriptor.ComponentType,
                    oldPropertyDescriptor,
                    BrowsableAttribute.No);
            }
            else
            {
                // If the property descriptor can not be substituted,
                // remove it from the Properties collection.
                e.Properties.Remove(propertyName);
            }
        }