Field Grouping FlexGrid

Posted by: jesusdevelop21 on 10 July 2023, 9:28 am EST

  • Posted 10 July 2023, 9:28 am EST - Updated 10 July 2023, 9:38 am EST

    I am are currently experiencing an issue with an encapsulated control that inherits from your control, C1.Win.Flexgrid. The problem arises when we group the Flexgrid’s information, as the alignment of the grouped cells matches that of the first column displayed in the Flexgrid it turns difficult to visualize a structure (As shown in the image below, the grouping of CO, Estado, and Item is aligned to the right, similar to the values in the Cantidad Inv column). While this may not affect functionality, it poses a usability problem for our clients.

    Image

    I would like to inquire whether there is a way to change the alignment of the grouping cells without altering the alignment of the remaining values in the column. In essence, I desire a structure similar to the native behavior of the control:

    Structure:

    Cantidad Inv … … … …

    — 01

    ----- Aprobado

    ------- 01302323

    --------- 3

    --------- 3

    --------- 3

    Since the control I am using encapsulates your control, it is challenging for us to provide a POC specifically for this issue (They are company security issues). However, I kindly request that you share a POC that emulates our requirement, and I will make an effort to adapt my control accordingly.

    **PD: **I am using Assembly C1.Win.C1FlexGrid.2, Version=2.0.20182.314 in a VB.NET desktop project with .NET framework version 4.6.2

  • Posted 11 July 2023, 3:25 am EST

    Hello,

    We too can observe this behavior at our end when grouped texts are of different data types. We have escalated this to the development team for investigation and will let you know as soon as we get the update from their end. [Internal Tracking ID: C1WIN-30716]

    As a workaround, you can use the GroupHeaderFormat property as given below to make every value into a single format(string):

    c1FlexGrid1.GroupHeaderFormat = "{value}:"

    Regards,

    Prabhat Sharma.

  • Posted 11 July 2023, 6:04 am EST

    Hello,

    As per the developers, FlexGrid uses different default aligning for different types of values. You can change aligning for rows with text aggregation using this code:

      c1FlexGrid1.Styles[CellStyleEnum.Subtotal0].TextAlign = TextAlignEnum.LeftCenter;
                c1FlexGrid1.Styles[CellStyleEnum.Subtotal1].TextAlign = TextAlignEnum.LeftCenter;
                c1FlexGrid1.Styles[CellStyleEnum.Subtotal2].TextAlign = TextAlignEnum.LeftCenter;
                c1FlexGrid1.Styles[CellStyleEnum.Subtotal3].TextAlign = TextAlignEnum.LeftCenter;
                c1FlexGrid1.Styles[CellStyleEnum.Subtotal4].TextAlign = TextAlignEnum.LeftCenter;
                c1FlexGrid1.Styles[CellStyleEnum.Subtotal5].TextAlign = TextAlignEnum.LeftCenter;

    Regards,

    Prabhat Sharma.

  • Posted 12 July 2023, 3:53 pm EST - Updated 12 July 2023, 3:59 pm EST

    Hello there,

    I’ve tried implementing the property you suggest but still don’t get what I want. In a few words what I want is a combination of styles in a column, some cells are aligned to the left and others align to the right. I attached and image of what I say.

  • Posted 13 July 2023, 6:27 am EST - Updated 13 July 2023, 6:32 am EST

    Hello,

    We do not face this issue at our end.

    Please find the attached sample and the screenshot demonstrating the same and let us know if you are doing anything different.

    Regards,

    Prabhat Sharma.

    FlexGridGroupDemo.zip

  • Posted 14 July 2023, 1:09 am EST - Updated 14 July 2023, 1:14 am EST

    Hello,

    As mentioned previously, I would like to reiterate that the control version I am currently using is 2, and I am working on a VB.NET desktop project. The demo you provided utilizes the control in version 4.5.0, and it is implemented in C#. While the programming language is not a concern for me, the discrepancy lies in the control version.

    Regrettably, I am unable to provide you with the exact control; however, I believe we can work with the provided example. In this example, the objective is to share a specific use case that I am encountering and seek a potential solution.

    Specifically, I would like to discuss the positioning of cell values (numerical) within the control and align them to the right. For example the values of the Scores column in this case, it goes align to the right.

  • Posted 14 July 2023, 1:12 am EST

  • Posted 14 July 2023, 5:21 am EST

    Hello,

    Thank you for your sample.

    The behavior that you are getting at your end is the default behavior when you are adding the node rows in the grid manually.

    As a workaround, what you can do is, you can apply the CellStyle to the cell with text alignment to the right side to the normal data cells.

    Please find the attached sample implementing the same.

    Regards,

    Prabhat Sharma.

  • Posted 14 July 2023, 5:22 am EST

Need extra support?

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

Learn More

Forum Channels