Created
June 14, 2013 12:00
-
-
Save sphingu/5781303 to your computer and use it in GitHub Desktop.
Style, Radio Button, DataGrid in WPF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to set Style to All Same Type of Controls | |
<Window.Resources> | |
//GroupBox,TextBox,Button,Grid | |
//Set background Black of all GroupBox in current Window | |
<Style TargetType="{x:Type GroupBox}"> | |
<Setter Property="Background" Value="Black"/> | |
</Style> | |
</Window.Resources> | |
//Use of Radio Button | |
<RadioButton Content="Male" Name="rbMale" IsChecked="True" GroupName="Gender" Checked="rbMale_Checked"/> | |
<RadioButton Content="Female" Name="rbFemale" GroupName="Gender" Checked="rbFemale_Checked"/> | |
//Use of Data Grid with Checkbox Check for Selected Row | |
<DataGrid Name="dgSource" CanUserSortColumns="False" IsReadOnly="True" CanUserAddRows="False" CanUserDeleteRows="False" AlternatingRowBackground="AliceBlue" | |
AlternationCount="2" AutoGenerateColumns="False" VerticalScrollBarVisibility="Visible" MinHeight="100" MaxHeight="250" Visibility="Collapsed" > | |
<DataGrid.Columns> | |
<DataGridCheckBoxColumn Header="Select" Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=DataGridRow}}" /> | |
<DataGridTextColumn Binding="{Binding Path=TABLE_NAME}" Header="Table Name" /> | |
</DataGrid.Columns> | |
</DataGrid> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment