hello friends.
i am using data grid in uwp application after installing external package from the nuGet.
now problem is i cant able to give the style fro the data grid in UWP :( i tried so may times. :(
even on internet i cant the solution fro this.
what i want to do :
1. i want change the header font and background color.
2. i want to change the color after selecting the row.
3. i want to give a border to the data grid with rounded corners.
please help me.. :(
thanks in advance :(
What I have tried:
<controls:DataGrid AutoGenerateColumns="False" CanUserResizeColumns="False" IsReadOnly="True" Margin="31,21,103,483" Name="UserListView" VerticalScrollBarVisibility="Auto" UseLayoutRounding="True" HorizontalScrollBarVisibility="Auto" TabIndex="4" FontSize="14" Background="White"
HeadersVisibility="Column" SelectedIndex="0" HorizontalGridLinesBrush="#E1E1E1" IsTabStop="True" RenderTransformOrigin="0.504,0.739" Grid.Row="2" BorderBrush="#E1E1E1" BorderThickness="1" Grid.Column="2" Grid.ColumnSpan="7" >
<controls:DataGrid.Columns >
<controls:DataGridTemplateColumn CanUserReorder="False" CanUserResize="False" Width="50" x:Name="userCheckBox" >
<controls:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<CheckBox Foreground="#444444" Height="10" Width="10" Margin="15,10,0,10" x:Name="IndvCheckBox" DataContext="{Binding userId}" Unchecked="UserUnchecked" Checked="UserChecked" UseLayoutRounding="True">
</CheckBox>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
<controls:DataGridTemplateColumn CanUserReorder="False" CanUserResize="False" Header="Name" Width="380" >
<controls:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<TextBlock Margin="10,20,0,10" x:Name="NameTextBox" Foreground="#444444" FontSize="12" FontFamily="Montserrat" >
<Run Text="{Binding userPrefix}" />
<Run Text="{Binding userFirstName}" />
<Run Text="{Binding userLastName}" />
</TextBlock>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
<controls:DataGridTemplateColumn CanUserReorder="False" CanUserResize="False" Header="Email" Width="380" >
<controls:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<TextBlock Margin="10,20,0,10" Text="{Binding userEmail}" x:Name="NameTextBox" Foreground="#444444" FontSize="12" FontFamily="Montserrat" />
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
<controls:DataGridTemplateColumn CanUserReorder="False" CanUserResize="False" Header="Phone" Width="250" >
<controls:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<TextBlock FontSize="12" Margin="10,20,0,10" Text="{Binding userPhone}" Foreground="#444444" FontFamily="Montserrat"/>
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
<controls:DataGridTemplateColumn Tag="Col" Header="Update" Width="*">
<controls:DataGridTemplateColumn.CellTemplate >
<DataTemplate>
<Image HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,20,0,10" Height="15" DataContext="{Binding userId}" Width="15" Source="Images/Edit.png" Tapped="GridUpdateBtnClick" />
</DataTemplate>
</controls:DataGridTemplateColumn.CellTemplate>
</controls:DataGridTemplateColumn>
</controls:DataGrid.Columns>
</controls:DataGrid>