When you paste data into cells that contain drop down lists, how do you stop them pasting data that isnt in the drop down lists? By default it seems to let you paste whatever you want into the cell and doesnt restrict them to pasting things that are in the dropdowns.
I tried using the ClipboardPasting event but couldnt find anything obvious to help me check the validity of the paste.
Thanks,Doug Rees
Polo Ralph Lauren
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:ValueConstraintEnumeration="{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.
Great. That seems to be it.
Thanks.
Hello Dong,
Sorry for the misunderstanding and thank you for re-explaining your issue. XamComboEditor’s property ValueConstraint is used to set the constraints of the input data for the editor. ValueConstraint has property called Enumeration that can be set to a collection that implements IEnumerable and represents the values that the editor can have. By setting this property you can restrict what value can be set to the editor even if you paste value from another cell.
I have created a sample application that binds the Enumeration to the same values as the ItemsSource of the XamComboEditor and does not allow pasting values that are not valid.
Please let me know if this is what you needed and if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
Hello Krasimir,
Im afraid you have missed my point. If you add copy and pasting to your grid (by adding AllowClipboardOperations="All") to the FieldLayoutSettings you can then paste invalid data into your comboboxes and the grid does not stop this. My post is about pasting data into these cells, not about having invalid data already in the combobox cells.
Try copying three cells from your second column and pasting them into your first column and you will see the grid does not stop this and your sample has no bearing on this issue as I think you misunderstood my issue.
Regards,Doug Rees
I have found a solution for your issue by EventSetter for EditModeEnding event in the EditorStyle for the XamComboEditor. Inside the event handler check for matching entered text in the XamComboEditor and existing items in the dropdown list is made and if no match is found changes are not accepted by setting e.AcceptChanges = false;.
I have created and attached a sample application that does the described above.