Hi - I have a WinGrid with two bands, master/detail relationship. When the the child band is revealed for a parent record, I want to resize the columns in the child rows based on visible data. I can do that in code no problem, but I can't find an event to use to fire the resize - I tried AfterRowExpanded on the parent row but it seems no data rows are visible at that time. I don't want to use AllRowsInBand because there are 40,000 of them and I am only showing five at a time.
It appears that when the code executes in the AfterRowExpanded that the rows either are not visible or do not contain data. I expand and columns are not resized. I fire the same code with a button when rows are visible and they resize correctly.
Any suggestions?
Hello,
Thank you for your feedback. Please do not hesitate to contact with us if you have any further questions.
Thank you for using Infragistics Components.
" if you review the sample you will see that the event occurs once if AfterRowExpanded event has been raised"
I have to study this some more - I hadn't looked at the event in the MyCreation class.
In any event, it seems that this works so until I've tried it and found a performance issue I'll assume there isn't one :-)
The event is called InitializeRowCollection but it occurs when the collection is initialize and not after the rows ware drawn, if want to resize based on VisibleRows, this meant that the rows should be drown. Also if you review the sample you will see that the event occurs once if AfterRowExpanded event has been raised . So please test the sample and feel free to modify it based on your custom needs.
On first glance, that seems as if it could work.
It seems like a complicated way to get to the result, though. Would be nice if there were an event like "InitializeChildRow" instead.
And by using .OnAfterCellCreated isn't this firing once for every CELL - meaning if there are 20 rows with 30 cells this will fire 600 times? I looked but there's no
I'll try it in my project and see what results I get.
Thanks
The other option is to make own implementation of Creation filter, in order to check id the cell of the specific column was created, in order to rise custom event and to call perform auto resize method there. I have implemented my suggestion in a small sample and I hope that this will works for you.
Please let me know if you have any further questions.