Best Control for Drag/Drop Single Item with Data Validation

1 Answer 55 Views
DragAndDrop General Discussions
Romain
Top achievements
Rank 2
Iron
Iron
Romain asked on 09 Aug 2023, 03:10 PM

Hi,

I'm looking for some advice on the best control to use for user input of a single element, though drag&drop , that also has data validation display.

I have used it on RadListBox, RadGridView and RadTreeView but in this case I do not have a collection to fill.

I would like for the control to bind to a single property of type Foo and use the DragDropManager / BeahviorManager / PayloadManager to control what can be dragged / dropped onto the control so that the bound variable is updated.

I would also like for the control to display any validation error through INotifyDataErrorInfo

I would appreciate any suggestions.

 

Thank you for your help.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 14 Aug 2023, 10:53 AM

Hello Romain,

There is no such control in the suite, but you can get the desired effect with some custom drag/drop behavior. To display a validation error on the corresponding control, you can set the WPF native Validation.ErrorTemplate attached property. Then on drag/drop (using the DragDropManager events), you can update the corresponding view model property which will raise the validation error and the content of the ErrorTemplate will be displayed.

You can find this approach shown in the attached project. Note that in the project, I am using one of the default validation error templates used by the Telerik input controls.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Romain
Top achievements
Rank 2
Iron
Iron
commented on 15 Aug 2023, 01:38 PM

Thank you for your help. Your example was helpful. 
Tags
DragAndDrop General Discussions
Asked by
Romain
Top achievements
Rank 2
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or