This is a migrated thread and some comments may be shown as answers.

Telerik RadGridView drag/drop - highlighting dropped rows

1 Answer 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhinav
Top achievements
Rank 1
Abhinav asked on 14 Feb 2017, 04:46 PM

Hi Telerik,

We've implemented the drag/drop feature for the RadGridView available in the code samples (using the RowReorderBehavior, etc).

Is there a way to highlight the rows that were dropped (i.e. GVR background=Orange)? We've made several attempts to no avail - is there a way to do this without binding to a property in the ViewModel?

 

Kind regards

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 17 Feb 2017, 02:58 PM
Hello,

In order to achieve your goal, you can use our RowStyleSelector as demonstrated in this article. You can add a boolean property of your model which will control which row will be highlighted. You can not rely on the visual elements and their properties (i.e. GridViewRow.Background) since RadGridView is virtualized control and the rows are reused on scrolling. This is why you need to work with the data item and a style selector. So, in the DropHandler you can change the IsHighLight property of your object and the style selector will do its job.


Regards,
Yoan
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Abhinav
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or