C1.FlexGrid 4.5.2

Posted by: santer.p75 on 8 January 2021, 8:36 pm EST

  • Posted 8 January 2021, 8:36 pm EST

    Hello, i use margins on C1.FlexGrid to make more space between text an borderlines. On my previous version it works great, now on the new editon of the c1.flexgrid it cuts the text.... Someone have the same issue?



  • Replied 10 January 2021, 6:51 pm EST

    Hi,

    did you try to call "AutoSizeRows"? Though this suggestion is not a resolution but only a workaround?

    Best regards

    Wolfgang
  • Replied 11 January 2021, 12:08 am EST

    Hello,

    As suggested by the Wolfgang, you need to use the AutoSizeRows() method of FlexGrid to show the data properly in the cells and the current behavior is the default behavior as adding margin will shift the cell content but not change the cell height.

    As you said that in previous version that you have, it was working properly so can you please let us know the build number so that we can verify the same at our end and assist you property.

    @Wolfgang, thank you for your help.

    Regards,
    Prabhat Sharma.
  • Replied 11 January 2021, 12:12 am EST

    Thank you Wolfgang, with the call of "AutoSizeRows" the row hight it ajusts....

    Regards
    Peter
  • Replied 11 January 2021, 2:42 am EST

    Hi,

    it was the Flex Grid 4.6.20141.828.

  • Replied 11 January 2021, 8:10 pm EST

    Hi Peter,

    We have checked the above given sample with 2014 builds but it works same as it is working with the latest builds.
    If you were doing something else then please share a stripped-down sample so that we can assist you accordingly.

    Regards,
    Prabhat Sharma.
  • Replied 12 January 2021, 7:26 am EST

    Hi,

    here the sample project.

    Regards
    Peter

    WindowsApplication1.zip
  • Replied 12 January 2021, 10:32 pm EST

    Hi Peter,

    The builds that you are using is too old and there has been so many internal changes done in the control over the years that can cause this behavior. You can use the AutoSizeRows method as suggested before to get it work as expected.

    Regards,
    Prabhat Sharma.
  • Replied 14 January 2021, 6:00 pm EST

    Thank you for the answer,

    is it possible to automate the AutoSizeRows method trough an event like AfterAddRow without loosing performance?
    I have insert manuly 150 entrys of AutoSizeRows in my code and i am just at 1/4 of the projecton the way, on every LoadForm event an on every AddItem i must call AutoSizeRows! I found in the documentation the defintion:

    Gets or sets the margins between the edges of the cell and its contents, in pixels.

    So i do not understand why the margins wont work without all the coding of AutoSizeRows?!? Margins between edges and its content is or me the right thing i wanna do

    Can i define the row height in some property of the felxgrid ?

    Regards
    Peter

  • Replied 14 January 2021, 11:43 pm EST

    Hi Peter,

    santer.p75 said:
    Can i define the row height in some property of the felxgrid ?


    This can be done through "c1FlexGrid.Rows.Height = 30"


    Attached is a small sample which handles the event "GridChanged": for the change type "GridChangedTypeEnum.CellChanged", AutoSizeRow is called.
    Instead of handling the event, you could also declare a C1FlexGrid subclass and override "OnGridChanged". Thus you could handle this in a base class and subclass all your grids from it.
    FlexAddItem.zip

    But I am not sure whether this approach has a performance impact - autosizing might happen too often.


    I agree with you: the issue sounds like a bug in C1FlexGrid.

    Best regards

    Wolfgang
  • Replied 15 January 2021, 12:46 am EST

    Thank you Wolfgang!!!!

    So i must learn to write that sub class to override the event, is there somewhere an sample snip code?

    Regards
    Peter
  • Replied 15 January 2021, 1:27 am EST

    See attached sample:
    FlexSubclass.zip

    Best regards

    Wolfgang
  • Replied 15 January 2021, 6:35 am EST

    Thank you Wolfang, you saved me a lot of time, it works fine, only the fxed rows wont be autosized but there i call AutoSizeRows on load, and this now is ok, i hope the bug will fix soon....
  • Replied 17 January 2021, 6:52 pm EST

    Hello Peter,

    We have forward this to the developers and will let you known once we get the update on this from their side.[Internal Tracking ID: 24195]

    @Wolfgang, thank you for your help.

    Regards,
    Prabhat Sharma.
Need extra support?

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

Learn More

Forum Channels