<DataGridTextColumn.EditingElementStyle> <Style TargetType="{x:Type TextBox}"> <Setter Property="MaxLength" Value="10"/> </Style> </DataGridTextColumn.EditingElementStyle>
Style CellStyleLength = new Style(typeof(DataGridCell)); CellStyleLength.Setters.Add(new Setter(TextBox.MaxLengthProperty, 10)); DataGridTextColumn c1 = new DataGridTextColumn { Header = "Anrede", Binding = new Binding("anrede"), Width = 200, CellStyle = CellStyleLength, }; DgrShow.Columns.Add(c1);
<DataGridTextColumn.EditingElementStyle> <Style TargetType="TextBox"> <Setter Property="MaxLength" Value="10"/> </Style> </DataGridTextColumn.EditingElementStyle>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)