Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • rebeldev
    Participant
    Post count: 7

    I don’t believe I can send a small project at this time. I’m sorry.

    After further investigation, it appears that a theme is being applied as far up the visual tree as the AvalonDock within which my entire view sits; I believe it is a Metro theme. Referring to my example, I set the background for the DataGrid, MaterialTabItem, MaterialTabControl, Grid, and even the UserControl at the head of the xaml file to different colors. No change.

    I’m guessing I need to override the theme somehow. Is there a way to do that?

    rebeldev
    Participant
    Post count: 7

    I apologize. I did have the DataGrid.Columns tags in my code; I just forgot to type them in my forum submission.

    I am using toolkit version 2.9 on Windows 7, Service Pack 1. My workgroup operates with the same toolkit version, and we simply haven’t upgraded to version 3.0, but that may happen soon. It is unknown when the operating system will be upgraded to Windows 10.

    It appears that the only difference between the code in your reply and my working code is the colors. I changed my colors to your suggested colors, but the outcome was the same — no alternating colors and no grid lines.

    I noticed that if I take away all the DataGrid columns and leave just the DataGrid.Columns tags, I see the alternating rows, but not the grid lines. Adding an empty DataGridTextColumn causes the alternating rows to appear, except for a thin strip on the left-hand side.

    To clarify, here is the code I am using:

    <Grid Background="Transparent"
           HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
         <xctk:MaterialTabControl Margin="5,5,5,5"
                                  ScrollViewer.VerticalScrollBarVisibility="Auto">
             <xctk:MaterialTabItem Header="Header1">
                 <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding DataCollection}"
                           AlternationCount="2" AlternatingRowBackground="LightYellow"
                           HorizontalGridLinesBrush="LightGray" VerticalGridLinesBrush="LightGray" >
                     <DataGrid.Columns>
                         <DataGridTextColumn Header="Header2" Binding="{Binding Path=Data1}"/>
                         <DataGridTextColumn Header="Header3" Binding="{Binding Path=Data2}"/>
                     </DataGrid.Columns>
                 </DataGrid>
             </xctk:MaterialTabItem>
         </xctk:MaterialTabControl>
    </Grid>

    Thank you.

Viewing 2 posts - 1 through 2 (of 2 total)