Validation.ErrorTemplate="{x:Null}
Search This Blog
Wednesday, June 8, 2016
WPF Validation remove red border on error
WPF > Validation > Remove red border on error
Labels:
Errors,
Validation
Tuesday, June 7, 2016
Clear Validation Error On TextBox TextChanged event WPF
WPF > Validation > ClearInvalid
Removes all ValidationError objects from the specified BindingExpression object.
Example
Removes all ValidationError objects from the specified BindingExpression object.
Example
this.TextChanged += TextBox_TextChanged;
void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{
Validation.ClearInvalid(((TextBox)sender).GetBindingExpression(TextBox.TextProperty));
}
Labels:
Validation
Friday, June 3, 2016
DataGrid WPF show row number
WPF > Controls > ItemsControl > DataGrid > Show row number
XAML
XAML
<DataGrid
x:Name="dataGrid"
LoadingRow="dataGrid_LoadingRow"
Code
private void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
// show
row number
e.Row.Header = (e.Row.GetIndex() +
1).ToString();
}
Labels:
DataGrid
Subscribe to:
Posts (Atom)