Home Forums WPF controls Xceed DataGrid for WPF Moving the DataGridControl.View code into a Resource ?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24021 |

    I have the following XAML code which specifies in the DataGridControl.View that the Theme and Grid lines should be set.

    How can I place this code (i.e. <xcdg:DataGridControl.View>…….)
    into a Resource so that it may be referenced Application wide ?

    The syntax I am having problems with i swhethere to create a Syyle or a Template

    <xcdg:DataGridControl
    AutoCreateColumns=”False”
    Grid.Row=”1″
    EditTriggers =”BeginEditCommand”
    CellEditorDisplayConditions=”RowIsBeingEditing”
    ItemsSource=”{Binding Source={StaticResource ods_MyData}}”
    ItemScrollingBehavior=”Immediate”
    ValidationMode=”CellEndingEdit”
    >

    <xcdg:DataGridControl.View>
    <xcdg:TableView HorizontalGridLineThickness=”1″ VerticalGridLineThickness=”1″>
    <xcdg:TableView.Theme>
    <xcdg:AeroNormalColorTheme/>
    </xcdg:TableView.Theme>
    <xcdg:TableView.HorizontalGridLineBrush>
    <SolidColorBrush Color=”Orange”/>
    </xcdg:TableView.HorizontalGridLineBrush>
    <xcdg:TableView.VerticalGridLineBrush>
    <SolidColorBrush Color=”Orange”/>
    </xcdg:TableView.VerticalGridLineBrush>
    </xcdg:TableView>
    </xcdg:DataGridControl.View>

    Imported from legacy forums. Posted by Desmond (had 617 views)

    User (Old forums)
    Member
    Post count: 23064

    Try this:
    <Style TargetType=”{x:Type xcdg:TableView}”>
    <Setter Property=”HorizontalGridLineThickness” Value=”1″/>
    <Setter Property=” VerticalGridLineThickness ” Value=”1″/>
    <Setter Property=”Theme” Value=”Aero.NormalColor”/>
    <Setter Property=”HorizontalGridLineBrush” Value=”Orange”/>
    <Setter Property=”VerticalGridLineBrush” Value=”Orange”/>
    </Style>

    Imported from legacy forums. Posted by Lena (had 306 views)

    User (Old forums)
    Member
    Post count: 23064

    Works a treat…thanks Lena…..

    Cheers,

    Dezzz.

    Imported from legacy forums. Posted by Desmond (had 3109 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.