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

Property Grid - Splitter Bar

7 Answers 15 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
WILLIAM
Top achievements
Rank 1
WILLIAM asked on 24 Feb 2014, 02:19 PM
Good Morning Telerik Team,

I'm trying to find the Splitter Bar property for the Property Grid and, more so, the event that is fired with it is moved/resized.

Thanks!!

7 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 24 Feb 2014, 02:24 PM
Hi,

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
Yoan
Telerik team
answered on 24 Feb 2014, 04:00 PM
Hello,

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
Yoan
Telerik team
answered on 25 Feb 2014, 10:47 AM
Hi,

This event was added with Q1 2013 version of our controls. 

Regards,
Yoan
Telerik
Tags
PropertyGrid
Asked by
WILLIAM
Top achievements
Rank 1
Answers by
Yoan
Telerik team
WILLIAM
Top achievements
Rank 1
Share this question
or