I would like for the RadGridView to display something like "No data to display" when there are no bound items to the RadGridView. I found some code online which solves the problem, however I would like to define it application wide.
I attempted to subclass RadGridView which compiles fine. However, whenever I use this subclass I get a compiler error, "
Which I guess is a known limitation of WPF. I would just like to specify the no row template once since I have an application with 30+ instances of RadGridView.
The code I found is from here, and is listed below:
I attempted to subclass RadGridView which compiles fine. However, whenever I use this subclass I get a compiler error, "
Cannot set Name attribute value {0} on element {1}. {1} is under the scope of element {2}, which already had a name registered when it was defined in another scope."
Which I guess is a known limitation of WPF. I would just like to specify the no row template once since I have an application with 30+ instances of RadGridView.
The code I found is from here, and is listed below:
<interactivity:Interaction.Behaviors> <local:EmptyDataTemplateBehavior> <local:EmptyDataTemplateBehavior.EmptyDataTemplate> <DataTemplate> <TextBlock Text="No data to display" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding MessageVisibility}" /> </DataTemplate> </local:EmptyDataTemplateBehavior.EmptyDataTemplate> </local:EmptyDataTemplateBehavior></interactivity:Interaction.Behaviors>