I have a grid that should display full information for some rows and only basic info and description for the others. E.g. there is a number, a description field and details after it for rows of type A and there's just a number and a description for a row of type B. The description field should extend till the end of the row and cover not relevant cells. The description is longer for B rows, so it makes sense for this column to be wide. All objects in a collection are of the same C# type, but there's a property that returns the type A or B. What are my choices? Would multiple fieldlayouts be a way? How? I also want the grid to always use the field descriptions from the A row even if the first row is B. I'd prefer XAML only solution, but I'll take whatever I can get :) Any ideas? Thanks.
So I am one step further. In code behind I used an AssigningFieldLayoutToItem event to set a different fieldlayout based on the type property. But I got header labels for each group of layouts. Which I got rid of by setting LabelLocation="Hidden" in FieldLayoutSettings. So the data looks exactly as I want it, but I have no labels now :) Is there a way to force one particular fieldlayout to create a header with labels? It would be enough if they just sat there, with no sorting or whatever functionality. I could even live with the columns not being resizable if it made things easier, but zooming in and out should keep the labels and cells synchronized.
Ivan
Hello Ivan,
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 used additional FieldLayouts with visible Labels. One of them is assigned to the first Record. After that the FieldLayouts with the hidden labels are used. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.