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?
Forums Home / ComponentOne / WinForms Edition
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?
Posted 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
Posted 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.
Posted 11 January 2021, 12:12 am EST
Thank you Wolfgang, with the call of “AutoSizeRows” the row hight it ajusts…
Regards
Peter
Posted 11 January 2021, 2:42 am EST
Hi,
it was the Flex Grid 4.6.20141.828.
Posted 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.
Posted 12 January 2021, 7:26 am EST
Hi,
here the sample project.
Regards
Peter
WindowsApplication1.zip[img]https://gccontent.blob.core.windows.net/forum-uploads/file-376b8285-90d3-4159-b4ca-b2430f09f1a0.PNG[/img]
Posted 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.
Posted 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
Posted 14 January 2021, 11:43 pm EST
Hi Peter,
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
Posted 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
Posted 15 January 2021, 1:27 am EST
Posted 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…
Posted 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.
Posted 17 March 2021, 10:04 pm EST
Hello Prabhat ,
are there any news to this bug?
Regards
Peter
Posted 18 March 2021, 1:12 pm EST
Hello,
As per the developers, the issue will get fixed in the 2021V1 Hotfix release.
Regards,
Prabhat Sharma.
Posted 18 March 2021, 10:11 pm EST
Is there also a date? I am blocked since January… yes it is possible a work around, but in the case of more the 300 grid in the project i have no wont to work twice, i lost a lot of time with the art of functionalitiy…
Posted 18 March 2021, 10:30 pm EST
Hello,
The Hotfix builds releases after the major release so 2021V1 HF is supposed to be released at end of April 2021.
Regards,
Prabhat Sharma.
Posted 1 August 2021, 6:37 pm EST
Hello,
how is up the Hotfix that i still waiting since end of April? Where can i get it?
Regards
Peter
Posted 1 August 2021, 9:04 pm EST
Hello Peter,
You can update to 2021V1 hotfix using the ComponentOneControlPanel utility by following the below-given steps:
https://www.grapecity.com/componentone/download
1: Run the ComponentOneControlPanel utility.
2: Go to PRODUCTS → BUILD REPOSITORY tab.
3: Check the Include Hotfix and Prerelease builds.
4: Select the 4.5.2.2021.1.502 version from the dropdown and update.
Regards,
Prabhat Sharma.