Resizing of hierarchy grid

3 posts, 0 answers
  1. Rodney
    Rodney avatar
    4 posts
    Member since:
    Sep 2011

    Posted 08 Dec 2011 Link to this post

    With "Nested Scroll Bars" turned on the user is able to re-size the hierarchy grid, what event can I use to capture this user action?
  2. Guy
    Guy avatar
    60 posts
    Member since:
    Sep 2010

    Posted 08 Dec 2011 Link to this post

    The GridVIew has a Resize Event, is that of any use?

    (i'm no way an expert, just thought I'd offer a suggestion)

    Guy
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 12 Dec 2011 Link to this post

    Hello Guy,

    There is no dedicated event for this case. You should create a custom detail view cell in order to get access to the child GridTableElement. Please consider the following sample:
    void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
    {
        if (e.CellType == typeof(GridDetailViewCellElement))
        {
            e.CellType = typeof(CustomDetailsCell);
        }
    }
     
    public class CustomDetailsCell: GridDetailViewCellElement
    {
        public CustomDetailsCell(GridViewColumn column, GridRowElement row)
            : base(column, row)
        {
        }
     
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(GridDetailViewCellElement);
            }
        }
     
        protected override GridTableElement CreateChildTableElement()
        {
            GridTableElement tableElement = base.CreateChildTableElement();
            tableElement.RadPropertyChanged += new RadPropertyChangedEventHandler(tableElement_RadPropertyChanged);
            return tableElement;
        }
     
        void tableElement_RadPropertyChanged(object sender, RadPropertyChangedEventArgs e)
        {
            if (e.Property == RadElement.BoundsProperty)
            {
                Console.WriteLine("Child view height: " + ((Rectangle)e.NewValue).Height);
            }
        }
    }

    Could you please describe in greater detail what you want to achieve? This will help us to focus on the issue and provide you with accurate support.
     
    Regards,
    Jack
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Back to Top