Hello,
I have a xamdatagrid which contains xamcomboeditors for some fields.
I am trying to resize my grid fields depending to contents by handling dataitem changes like this :
//pseudo
DataItemChanged(sender,propertyname)
{
var field = grid.layouts[0].fields.find(x=>x.name == propertyname);
field.PerformAutoSize(FieldAutoSizeOptions.All, FieldAutoSizeScope.ViewableRecords);
}
but it doesn't work properly.Field doesn't extend when comboeditors value changed firstly then it extends although the selected items length of comboeditor is the same as first selected item.I'm controlling field.CalculateAutoSizeExtent(FieldAutoSizeOptions.All, FieldAutoSizeScope.ViewableRecords) and this method returns NaN.
In which cases this method returns NaN?,how this methods work? ,i couldn't find enough documentation.
Thanks.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Thank you very much,it works for me.
I have been looking into the sample and I modified it, so now it works as you want. Basically I used a Dispatcher to delay the AutoSizing, because it is too early to do it in the event you use. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thank you very much for reply,i edited your sample project to show how i use the performautosize method.I still have same problem on my usage.Project is attached.
Thank you for your post. I have been looking into it and I created a sample project for you using the same approach like yours and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.