RadGridView CustomControl in .NET 6

0 Answers 88 Views
GridView
Evangelista
Top achievements
Rank 1
Iron
Evangelista asked on 20 Dec 2023, 01:20 PM

Hi,

Testing a gridview custom control with .NET 6 does not render on screen.

The same example with .net framework works.


 public class CustomGrid : RadGridView
 {
     static CustomGrid()
     {
         DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomGrid), new FrameworkPropertyMetadata(typeof(CustomGrid)));
     }

     protected override void OnInitialized(EventArgs e)
     {
         base.OnInitialized(e);
                 
     }
 }


 <Grid>
     <my:CustomGrid Grid.Row="0"
                   x:Name="clubsGrid" 
                   AutoGenerateColumns="False"
                   GroupRenderMode="Flat"
                   Margin="5">
         <my:CustomGrid.Columns>
             <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
             <telerik:GridViewDataColumn DataMemberBinding="{Binding Established}" Header="Est." DataFormatString="{}{0:yyyy}"/>
             <telerik:GridViewDataColumn DataMemberBinding="{Binding StadiumCapacity}" Header="Stadium" DataFormatString="{}{0:N0}"/>
         </my:CustomGrid.Columns>
     </my:CustomGrid>
 </Grid>

Thanks.
Stenly
Telerik team
commented on 20 Dec 2023, 01:44 PM

May I ask if you could check the following article from our documentation?

Styling the Controls - Telerik UI for WPF

More specifically, the Styling Custom Controls section from it.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Evangelista
Top achievements
Rank 1
Iron
Share this question
or