How do I extract the error icon to use in other controls

3 posts, 1 answers
  1. Karl
    Karl avatar
    37 posts
    Member since:
    Dec 2013

    Posted 15 Aug Link to this post

    I would like to take the row error indicator icon and display it in a different control (not a gridview).  Is this possible?

  2. Answer
    Sia
    Admin
    Sia avatar
    685 posts

    Posted 17 Aug Link to this post

    Hello Karl,

    Yes, it is possible. The row error icon is a path in some themes, in others it is a glyph. It can be found in the GridViewRow ControlTemplate under the x:Name ErrorIndicator.

    For example in Office Black theme (I have reworked it a little for you): 
    <Grid x:Name="ErrorIndicator" HorizontalAlignment="Center" VerticalAlignment="Center" Width="16" Height="16" SnapsToDevicePixels="True" Margin="50 0  0 0">
        <Path Fill="{StaticResource GridView_ErrorIndicatorBackground1}" Stretch="Fill" Margin="1"
                Data="M11,12 L12,12 12,13 11,13 z M2,12 L3,12 3,13 2,13 z M12,11 L13,11 13,12 12,12 z M1,11 L2,11 2,12 1,12 z M13,3 L14,3 14,11 13,11 M0,3 L1,3 1,11 0,11 z M12,2 L13,2 13,3 12,3 z M1,2 L2,2 2,3 1,3 z M11,1 L12,1 12,2 11,2 z M2,1 L3,1 3,2 2,2 z M11,13 L11,14 3,14 3,13 M11,0 L11,1 3,1 3,0"/>
        <Path Fill="{StaticResource GridView_ErrorIndicatorBackground2}" Stretch="Fill" Margin="7 3"
                Data="M0,8 L1,8 2,8 2,9 2,10 1,10 1,9 1,10 0,10 0,9 z M0,0 L1,0 2,0 2,1 2,2 2,3 2,4 2,5 2,6 2,7 1,7 0,7 0,6 0,5 0,4 0,3 0,2 0,1 z"/>
        <Path Fill="{StaticResource GridView_ErrorIndicatorBackground3}" Stretch="Fill" Data="M12,14 L13,14 13,15 12,15 z M3,14 L4,14 4,15 3,15 z M13,13 L14,13 14,14 13,14 z M2,13 L3,13 3,14 2,14 z M14,12 L15,12 15,13 14,13 z M1,12 L2,12 2,13 1,13 z M7,13 L9,13 9,11 7,11 M16,11 L16,12 15,12 15,4 16,4 M0,4 L1,4 1,12 0,12 M14,3 L15,3 15,4 14,4 z M1,3 L2,3 2,4 1,4 z M13,2 L14,2 14,3 13,3 z M2,2 L3,2 3,3 2,3 z M12,1 L13,1 13,2 12,2 z M3,1 L4,1 4,2 3,2 z M12,2 L12,3 13,3 13,4 14,4 14,12 13,12 13,13 12,13 12,14 4,14 4,13 3,13 3,12 2,12 2,4 3,4 3,3 4,3 4,2 M4,1 L4,0 12,0 12,1 M12,15 L12,16 4,16 4,15 M9,3 L7,3 7,10 9,10 9,9"/>
    </Grid>

    and in Material theme: 
    <Grid x:Name="ErrorIndicator" HorizontalAlignment="Center" Width="16" Height="16" VerticalAlignment="Center">
        <TextBlock
                Text="{StaticResource GlyphWarning}"
                FontFamily="{StaticResource TelerikWebUI}"
                Foreground="{telerik1:MaterialResource ResourceKey=ValidationBrush}"
                FontSize="16"
                FontWeight="Normal"
                FontStyle="Normal"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"/>
    </Grid>

    I hope this helps.

    Regards,
    Sia
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Karl
    Karl avatar
    37 posts
    Member since:
    Dec 2013

    Posted 17 Aug in reply to Sia Link to this post

    I downloaded the source and used this info to find the paths I was looking for, thanks.
Back to Top