Problem with Shape control in AR 15.1.1 version

Posted by: vbie on 21 September 2021, 7:47 am EST

  • Posted 21 September 2021, 7:47 am EST

    Hello, all!

    We use version of the AR 15.1.1. When I try to add Shape control on layout Property grid doesn’t show any information about Shape control properties.

    It happens only for Shape control. I have the next exception when set PropertyGridFilter object to PropertyGrid.SelectedObjects

    System.NullReferenceException

    HResult=0x80004003

    Message=Object reference not set to an instance of an object.

    Source=GrapeCity.ActiveReports

    StackTrace:

    at GrapeCity.ActiveReports.SectionReportModel.ShapeConverter.GetProperties(ITypeDescriptorContext context, Object value, Attribute attributes)

    Do you have any idea why this might be happening? I just can’t seem to get the more specific error message.

  • Posted 22 September 2021, 5:05 am EST

    Hello,

    Can you please provide the code snipped with me so that I can narrow down the issue?

    Thanks,

    Mohit

  • Posted 22 September 2021, 6:13 am EST

    UserControlProperties.SelectedObjects = selectedControls.ToArray();

    Where UserControlProperties inherits from System.Windows.Forms.PropertyGrid.

    selectedControls is list that contains objects PropertyGridFilter.

    Constructor PropertyGridFilter

    public PropertyGridFilter(object callObj, SCCDesigner designer)

    {

    AppPropertyGridFilter.Instance = this;

    InitDataFieldList();

    	    sccDesigner = designer;
    	    wrapObj = callObj;
    

    So, how you can see callObj is Shape in this case.

    We get error when try to set Array of PropertyGridFilter, where wrapObj contains Shape

  • Posted 22 September 2021, 6:12 pm EST

    Hello,

    You can directly set the property grid with designer using the following code:

    designer1.PropertyGrid = propertyGrid1;

    Thanks,

    Mohit

  • Posted 23 September 2021, 7:50 pm EST

    All standard controls work is good, except shape control. I dont understand why this happens.

    If I set something wrong, then other converters on GetProperties(ITypeDescriptorContext context, Object value, Attribute attributes) would also throw an error. Based on the log, I do not understand which property can throw this error

  • Posted 23 September 2021, 10:07 pm EST

    Hello,

    Can you share the sample with me so that I can replicate the same at my end?

    Thanks,

    Mohit

  • Posted 7 October 2021, 4:26 am EST

    You can find a sample in attachment. The problem is actual only for Shape control.

    Look at code

     var selectedControls = new List<object>();
                //NORMAL
                //var callObj = new GrapeCity.ActiveReports.SectionReportModel.Shape();
    
                //ERROR
                var callObj = new PropertyGridFilter(new GrapeCity.ActiveReports.SectionReportModel.Shape());
    
                //NORMAL
                //var callObj = new PropertyGridFilter(new GrapeCity.ActiveReports.SectionReportModel.Line());
    
                selectedControls.Add(callObj);
                propertyGrid1.SelectedObjects = selectedControls.ToArray();
    ```[zip filename="ShapeProblem.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-51953ecc-e6db-49c1-82d0-0bfda797169c.zip[/zip]
  • Posted 7 October 2021, 5:21 pm EST

    The same problem exits for CrossSectionBox control

  • Posted 11 October 2021, 10:47 pm EST

    Hello,

    Sorry for the delay.

    I have escalated the issue to the development team(AR-27529) and will inform you once I got any reply from them.

    Thanks,

    Mohit

  • Posted 23 December 2021, 9:09 pm EST

    Any news on this issue? Perhaps you have some other solutions, how can you get around these problems for these two controls?

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels