C1FlexPie: use ICustomTypeDescriptor for data row

Posted by: wknauf on 2 September 2024, 10:15 am EST

  • Posted 2 September 2024, 10:15 am EST - Updated 2 September 2024, 10:20 am EST

    Hi C1,

    this is a rather complex one, so have a cup of coffee before reading ;-).

    I try to implement a configurable FlexChart and FlexPie implementation in our dashboard. So, the datasource is a list of data rows, each row is a class that consists of an array of values. The source is e.g. a SQL select, but the underlying DataReader was closed and the data was copied to a container class that we use internally. So I cannot bind the DataReader to the chart, but I can bind the list of rows.

    After digging through the C1FlexChart decompiled code, I found that my data row class can implement “ICustomTypeDescriptor”. Following the approach from https://keuperict.nl/posts/development/2017/09/26/icustomtypedescriptor-interface/, I can bind a field name of the sql statement to a column value in my row data array.

    Great, problem solved for FlexChart!

    But FlexPie works slightly different, and here my approach does not work.

    The call to “ICustomTypeDescriptor” is done in method “DataUtils.GetValue(object obj, string propertyName)”:

    FlexChart calls it here:

    FlexPie just accesses a PropertyInfo object instead of using “DataUtils.GetValue(object obj, string propertyName)”:

    I hope this can be easily added, and I hope it resolves my requirement.

    If needed I can create a sample.

    Best regards

    Wolfgang

  • Posted 2 September 2024, 2:26 pm EST

    Attached is a sample:

    FlexChartCustomTypeDescriptor.zip

    The class “ChartData” is a class with real properties “Key” and “Val1” to “Val12” (all beyond “Val4” are empty).

    The class “DataRow” consists of a list of objects, which are the cell values (it is basically an array). It implements “ICustomTypeDescriptor”.

    C1FlexChart calls the method “DataRow.GetProperties” and thus “CustomPropertyDescriptor,GetValue”. This does not happen with C1FlexPie.

    Best regards

    Wolfgang

  • Posted 3 September 2024, 3:26 am EST - Updated 3 September 2024, 3:55 am EST

    (deleted this post)

  • Posted 3 September 2024, 8:13 am EST

    Hi Wolfgang,

    Your latest comment on this post says, “deleted this post”. Could you please confirm what do you mean by this?

    Has this issue been resolved on your end?

    Or do we have to investigate it based on the initial information that you have provided?

    Please clarify on how to proceed with this issue.

    Thanks & Regards,

    Aastha

  • Posted 3 September 2024, 8:22 am EST

    Hi Aastha,

    I had posted an additional question and found a way to resolve that. So I wanted to delete this post, and as this is not possible, I changed the text to “deleted”. Sorry for the confusion!

    Yes, could you please check my initial query about “ICustomTypeDescriptor”?

    Best regards

    Wolfgang

  • Posted 4 September 2024, 9:31 pm EST

    Hi Wolfgang,

    Thanks for the clarification.

    We are discussing your issue with the developers. [Internal Tracking ID: C1WIN-32899] We will update you on this as soon as we hear back from them.

    Thanks & Regards,

    Aastha

  • Posted 6 September 2024, 7:46 am EST

    Hi Wolfgang,

    The developers have identified this issue as bug. [Internal Tracking ID: C1WIN-32901]

    The ETA for the fix of this issue is 2024v2.

    Thanks & Regards,

    Aastha

Need extra support?

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

Learn More

Forum Channels