Hi,
I am blocked at xamdatagrid validation for 2 days now. I have exercised your forum's answers but none of them helped me.
I am using a xamcomboeditor on a field, and setting itemsprovider via style using:
<igEditors:ComboBoxItemsProvider x:Key="ComboItemsProvider" ItemsSource="{Binding Path=ListOfModels, Source={StaticResource viewModel}}" DisplayMemberPath="Name" ValuePath="Id"/>
Problem is that, now if I want to use Clipboard operations, ("ALL"), this cell is accepting anything. Not checking if the item being pasted is available in the list of items.
FYI: I have tried using this:
<Setter Property="ValueConstraint"> <Setter.Value> <igEditors:ValueConstraint Enumeration="{Binding Source={StaticResource ComboItemsProvider}}"/> </Setter.Value> </Setter>
seems like enumeration not binding properly.
PS: I have also tried binding this enumeration with another class that has the same list (which is redundant and not right), but it doesnt work even then.
Please help me out.
Hello,
Thank you for your post. I have been looking into it and I can suggest you set the BindingPath of the ValueConstraint’s Enumeration’s Binding to “ItemsSource” like this:
<Setter Property="ValueConstraint"> <Setter.Value> <igEditors:ValueConstraint Enumeration="{Binding Source={StaticResource ComboItemsProvider},Path=ItemsSource}"/> </Setter.Value> </Setter>
Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Thanks for the reply.I tried this and got validation error (Invalid value) on pasting wrong value but also even when I select any other item from the comboeditor itself.
Were you able to check the sample I uploaded. I believe there everything works as you want. If it doesn't;'t satisfies all your needs could you please modify the data there and use the settings you shared and send the sample back , so I would be able to investigate it further for you.
I tried your sample and I compared it with my project and there's just the itemsource binding difference, as I am using MVVM approach, which (I guess) is causing the validation issue.
Sorry, I couldn't modify your uploaded sample. There seems to be some binding issue.
Can you modify the sample with a dictionary (present in ViewModel) binded with the itemsource instead of "ObjectDataProvider" from "Sector" class?
That would clear all differences, I guess.
Thanks.
I have been looking into your bindings and I can say the reason for your issue is the items source of the enumeration. As I said in my previous email, you should use a converter to return a list based on the dictionary you bind to the enumeration. You can check my sample, where I implemented this. Please let me know if you need further assistance on this matter.
Sorry for late reply.
I tried implementing the converter but that too doesn't help.
Something seems weird here. I hope you have tried my previous comment...
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Hello.
I am just checking were you able to create an isolated sample, where your issue is reproduced.
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I have been looking into the sample and I modified it, so now it works as you want. The issue wasn't related to the XamTabControl, and to the ItemsSource of the ValueConstraint in the second XamDataGrid. There the values are string and the Converter should return the Keys, not the Values. Also the ValuePath of the ComboBoxItemsProvider should be set to Key, because the underlying value is string. Please let me know if you need further clarifications on this matter.
Hi, thanks for the concern. =)
I have reproduced the issue in the sample attached. Please have a look at it.
PS: Seems like the problem is arising when working with XamTabControl and/or multiple XamDataGrids.
Thanks
If you could send me the sample where, this is reproduced, I will be able to investigate it further for you.