Hello,
I#m using XamDataGrid for WPF now for a couple of years and I must say, if you know how to do things, it's pretty awesome.
But this one I struggle:
I have grid which contains a couple of columns and the first one is unbound. Basically, I have a custom CellValuePresenterStyle and I'm showing a button for a special action on this row. That's working very good.
On the second I have a normal field and I have set IsScrollTipField = true and I get this error message:
"The Field cannot be made the 'ScrollTipField' unless it is contained in the Fields collection of the Owner."
I don't understand what it's trying to tell me? What's the issue? How to solve it?
Here for better understand my two columns as source code:
<ig:Field BindingType="Unbound" Width="18" FixedLocation="FixedToNearEdge"> <ig:Field.CellValuePresenterStyle> <Style TargetType="{x:Type ig:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Button Height="16" Width="16" Click="Print_Clicked" IsEnabled="{Binding DataItem.IsPrintable}"> <Image Source="/ISD.PRINCE;component/Images/Printer.png" /> </Button> </ControlTemplate> </Setter.Value> </Setter> </Style> </ig:Field.CellValuePresenterStyle></ig:Field><ig:Field Name="WO" Label="{isd:Translation Key=Common.WorkOrder}" FixedLocation="FixedToNearEdge" IsScrollTipField="True"/>
Hi Timon,
Thank you for posting in our forums.
This error happens when the grid is unable to find the field in its field collection. I created a small sample using the provided xaml (as much as I was able to use from it, without having your data) in order to reproduce this error and everything works fine in it – the grid was able to use the field for the scroll tips. I have attached my sample so you can test it as well. Please modify it so it reproduces your issue. I need to be able to reproduce this issue locally on my computer in order to be able to determine what the root cause is for it and what the best way to resolve it is.
Thank you for your collaboration.
Hi Dimitar,
thanks for your fast reply!
You're example working and I can't reproduce it on that.
Meanwhile I found out, when I close the XAML file, the error is gone and the software is working as expected. As soon as I open the xaml file again, the errors appear.
Do you have a tip how I can debug the design code? How can I bring up any exception which occurs in design time?
I can imagine that I have an error in underlying code since your example is working fine.
Thanks for your quickly help! I really appreciating it.
Thank you for the reply.
Unfortunately, I believe it would be very difficult for you to debug this issue on your side. It would require you to build the XamDataGrid source code and open two instances of Visual Studio – one with your application, the other attached to the first one and with the XamDataGrid source code loaded. It would be a lot better if you can provide us with an application that reproduces the issue. One way to do this is if you start with your real application and remove all the unnecessary to reproduce the issue parts. I can open a ticket for you in our system, if privacy is a concern.
Another option is to work around this by setting the IsPrimary property to true, instead of setting IsScrollTipField property on the field. If no field is set to be a scroll tip field, the primary field will be used instead and it can be set explicitly with the help of the IsPrimary property. Note that this may have side effects, like highlighting, if you have set the HighlightPrimaryField property, but other than that setting the IsPrimary property will have the same effect as setting the IsScrollTipField one. For more information on this, please follow this link:
http://help.infragistics.com/Help/Doc/WPF/2011.2/CLR4.0/html/InfragisticsWPF4.DataPresenter.v11.2~Infragistics.Windows.DataPresenter.Field~IsScrollTipField.html
I am looking forward to hearing from you.
thanks for your answer and opperunity to send you the code privatly which I like to use.
Please give me instructions how you send you our source code and after we found a solution, I'll post it here on the forum, so everybody has the solution.
Thanks!
I have created the private case (CAS-186491-X9X1T5) and you can view it from the following link:
https://www.infragistics.com/my-account/support-activity
You can provide me with the sample through the case itself.
Hello Ditmar,
I see the very same problem with WPF 16.2 and VS 2017.
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout>
<!-- there a number of other fields, summaries etc.-->
<igDP:Field Label="Baustelle" Name="BaustellenBezeichnung" IsReadOnly="True" AllowEdit="False" DisallowModificationViaClipboard="True" IsScrollTipField="True" Width="Auto" />
I don't understand how a field that is listed in FieldLayout cannot not be part of the FieldCollection.
The errors goes away when I close the XAML designer window.
Are there any news on this subject?
Thanks
Niko
Niko,
This was logged as development issue 241479 and that fix was included in the October 2017 service release which is the last service release for 2016 Volume 2. The specific version of the service release is 16.2.20162.2237 so if you are using an earlier version of 2016 Volume 2, I recommend that you get the latest service release from the my keys and downloads page.