Hello,
I need to display an array with a random amount of headers and lines.
I can have 2 to 20 columns and 10 to 200 lines.
So I need to be able to bind a list of headers and lines, all objects are in strings.
I already have another xamDatagrid with custom xaml style, so I would like to re-use it.
Thnaks for your help.
Regards
I am just checking if there is anything else I can do for you.
Thank you for your post.
I have been looking into it and I am not sure that understand what you are trying to achieve correctly. Would you please provide me with more details about what you want to style, it will be great if you could share sample project that illustrate the issue, so I will be able to further investigate it for you.
Looking forward to hearing from you.
After some tests, I keep your solution with NumericEditor.
Now, I play with xaml lines and style setter.
I saw that you have a <Trigger Property="IsInEditMode" Value="True"> in XamMaskedEditor, if I want to style it when EditMode = false to have foreground with black color, how to code it ?
The list of period is dynamic so I can't hard code it.
I don't use UnboundField because it's too old for resharper/codeMaid so I use a field.
I try to get the previous field (that is fixed) and change the title but I have an exception.
Maybe the solution is to set the style as a cellValuePresenter or as a label.
All cells are empty and I know that the collection is good.
Hello ,
Thank you for your feedback.
I have been looking into the sample application that you have provided and I am not sure how exactly you want to display your inner collection(Periods). It seems that the issue that you have described is caused by your view model. You can display your data in hierarchical grid, please see the attached image. In order to be able to achieve this, you just have to set AutoGenerateFields property of XamDataGrid to true.
If you want you can use UnboundField or you can set BindingType property of Field to Unbound. In CellValuePresenterStyle of this field you can create style for CellValuePresenter and set its Template property. In in it you can create ControlTemplate with TextBlock and by using MultiBinding you can set the DataContext of TextBlock to the current item of Periods collection. I modified you sample application in order to be able to show you how you can implement this approach.
Please let me know if you need any further assistance on the matter.