7 Answers, 1 is accepted
0
Hi,
Regards,
Yoan
Telerik
You can try to use ChildrenOfType<>() extension method and find the underlying element. In your case it will be the PropertyGridColumnResizer. Please check the following code snippet for a reference:
private void propertyGrid_Loaded(object sender, RoutedEventArgs e)
{
var cr = this.propertyGrid.ChildrenOfType<
PropertyGridColumnResizer
>().FirstOrDefault().ChildrenOfType<
Thumb
>().FirstOrDefault();
cr.DragDelta += new DragDeltaEventHandler(cr_DragDelta);
}
I hope this helps.
Regards,
Yoan
Telerik
0
WILLIAM
Top achievements
Rank 1
answered on 24 Feb 2014, 02:27 PM
Thanks for the quick reply, I will give that a try!
0
WILLIAM
Top achievements
Rank 1
answered on 24 Feb 2014, 03:24 PM
This almost works. When the PropertyGrid.Loaded event fires the first time, there is no PropertyGridColumnReszier in the tree. Only on subsequent PropertyGrid.Loaded events is there PropertyGridColumnReszier. I need to get the first time. Is there a different event on the PropertyGrid that happens later where the PropertyGridColumnResizer has been added to the tree?
0
WILLIAM
Top achievements
Rank 1
answered on 24 Feb 2014, 03:37 PM
Also, once I do get the PropertyGridColumnResizer, there is no Thumb in the tree either.
0
Hello,
Regards,
Yoan
Telerik
You can try to handle RadPropertyGrid's FieldLoaded event and execute the following code with dispatcher:
private void propertyGrid_FieldLoaded(object sender, FieldEventArgs e)
{
this.Dispatcher.BeginInvoke(new Action(() =>
{
var cr = e.Field.ChildrenOfType<
PropertyGridColumnResizer
>().FirstOrDefault().ChildrenOfType<
Thumb
>().FirstOrDefault();
cr.DragDelta += new DragDeltaEventHandler(cr_DragDelta);
}));
}
void cr_DragDelta(object sender, DragDeltaEventArgs e)
{
}
}
Regards,
Yoan
Telerik
0
WILLIAM
Top achievements
Rank 1
answered on 24 Feb 2014, 06:03 PM
Where is this event? I don't see the PropertyGrid.FieldLoaded event.
0