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

Column rendering in inherited grid.

3 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
AnnS
Top achievements
Rank 1
AnnS asked on 21 Apr 2010, 07:31 PM
On inheriting from "RadGridView" and overriding the "OnApplyTemplate" the only the first column is rendered.
namespace WpfApplication7 
    public class  MyGrid : RadGridView 
    { 
        public override void OnApplyTemplate() 
        { 
            //Custom Code. 
        } 
    } 
 

<Window x:Class="WpfApplication7.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:gridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    xmlns:local="clr-namespace:WpfApplication7" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window1" Height="300" Width="300"
    <Grid> 
        <local:MyGrid> 
            <gridView:RadGridView.Columns> 
                <gridView:GridViewColumn Header="Column1"/> 
                <gridView:GridViewColumn Header="Column2"/> 
                <gridView:GridViewColumn Header="Column3"/> 
                <gridView:GridViewColumn Header="Column4"/> 
            </gridView:RadGridView.Columns> 
        </local:MyGrid> 
    </Grid> 
</Window> 
 

Am I doing something wrong


3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 22 Apr 2010, 07:01 AM
Hi,

You may need to call the base method.

Greetings,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
AnnS
Top achievements
Rank 1
answered on 22 Apr 2010, 08:51 PM
No. It does not work Vlad.

public override void OnApplyTemplate()  
        {  
            base.OnApplyTemplate(); 
            //Custom Code.  
        }  

0
Vlad
Telerik team
answered on 26 Apr 2010, 08:24 AM
Hi,

You can try the attached application - just uncomment base.OnApplyTemplate and the grid columns will be displayed.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
AnnS
Top achievements
Rank 1
Answers by
Vlad
Telerik team
AnnS
Top achievements
Rank 1
Share this question
or