Hi,
I would like to know how to change the size of a record programmatically. I am writing some code that will auto size the fields and records based on the content of the CellValuePresenters. For the fields, I can simply say field.Height or field.Width and set the size. But I cannot do this with Records. I have tried setting the DataRecordPresenter size but this doesn't quite get the job done. There must be some easy way to set the record size that I'm not seeing.
Thanks,
-Chris
Hello Chris,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I get an element of type VirtualizingDataRecordCellPanel from the DataRecordPresenter and set its height. I also added a code which you can uncomment, if you want to change the height of the editors inside the cells as well. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hi Stefan,
Thank you for looking into this. I still have an issue where after I set the height/width of the record, if the user tries to manually change the size of the record, it doesn't work. I used your example to test except I added DataRecordSizingMode = "IndividuallySizable" under FieldLayoutSettings. It seems that after setting the record height/width, the record will no longer resize automatically if the user changes the size in the grid. Is there a way around this? I would like to retain the ability for the user to manually resize after the app automatically sizes the records on loading.