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

Event when user pins/unpins a row

2 Answers 13 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 07 Dec 2018, 07:48 AM

Hello,

I have a grid with a GridViewPinRowColumn and I need to detect, when the user has pinned or unpinned a row. Is there an event which I can subscribe?

Best regards,
Thomas

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 11 Dec 2018, 05:36 PM
Hello Thomas,

Currently there isn't such an event, however you can bind the IsPinned property of the row to a property in your model. Here is what I have in mind:
<Style TargetType="telerik:GridViewRow">
            <Setter Property="IsPinned" Value="{Binding IsPinned, Mode=TwoWay}" />
        </Style>

Please, give this approach a try and let me know if it works for your scenario.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Thomas
Top achievements
Rank 1
answered on 12 Dec 2018, 08:31 AM

Hello Vladimir,

thanks for your reply. In the meantime I have found a workaround accessing the private property PinnedItemsView:

PropertyInfo pinnedProperty = typeof(DataItemCollection).GetProperty("PinnedItemsView", BindingFlags.NonPublic | BindingFlags.Instance);
QueryableCollectionView pinnedItems = pinnedProperty.GetValue(myGrid.Items) as QueryableCollectionView;
pinnedItems.CollectionChanged += ...

 

But I will try your approach to make this less hacky.

Best regards,
Thomas

Tags
GridView
Asked by
Thomas
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or