Is there an easy way to give rounded corners to the boundary of a DataGrid in Silverlight 3?
Thanks a bunch!
Is there an easy way to give rounded corners to the boundary of a DataGrid in Silverlight 3?
Thanks a bunch!
Hi there, try this one:
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FF508EB1" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
<Grid Background="{x:Null}" x:Name="MainGrid" >
<Grid.Effect>
<DropShadowEffect />
</Grid.Effect>
<...>
</Grid>
</Border>
I just answered a similar question here for giving rounded corners to any FrameworkElement by attaching a Blend clipping behavior with a specified CornerRadius.
You could write your own logic for the clipping behavior or use the one from the Expression Blend Samples CodePlex page. It would then be as simple referencing System.Windows.Interactivity.dll from the Blend SDK and dropping the behavior on the element in Blend or writing out the XAML:
<data:DataGrid>
<i:Interaction.Behaviors>
<samples:ClippingBehavior CornerRadius="15"/>
</i:Interaction.Behaviors>
</data:DataGrid>
Its a nice reusable way to give rounded corners to any element without relying on a border or an element with corner radii properties.