Property Grid - Splitter Bar

8 posts, 0 answers
  1. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 24 Feb 2014 Link to this post

    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!!
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 24 Feb 2014 Link to this post

    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
  3. DevCraft banner
  4. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 24 Feb 2014 in reply to Yoan Link to this post

    Thanks for the quick reply, I will give that a try!
  5. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 24 Feb 2014 in reply to Yoan Link to this post

    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?
  6. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 24 Feb 2014 in reply to WILLIAM Link to this post

    Also, once I do get the PropertyGridColumnResizer, there is no Thumb in the tree either.
  7. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 24 Feb 2014 Link to this post

    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
  8. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 24 Feb 2014 in reply to Yoan Link to this post

    Where is this event?  I don't see the PropertyGrid.FieldLoaded event.
  9. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 25 Feb 2014 Link to this post

    Hi,

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

    Regards,
    Yoan
    Telerik
Back to Top
DevCraft banner