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

Resizing of hierarchy grid

2 Answers 120 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rodney
Top achievements
Rank 1
Rodney asked on 08 Dec 2011, 05:06 PM
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 Answers, 1 is accepted

Sort by
0
Guy
Top achievements
Rank 1
answered on 08 Dec 2011, 05:28 PM
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
0
Jack
Telerik team
answered on 12 Dec 2011, 05:45 PM
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.

Tags
GridView
Asked by
Rodney
Top achievements
Rank 1
Answers by
Guy
Top achievements
Rank 1
Jack
Telerik team
Share this question
or