Skip to content

Commit cf13353

Browse files
committed
focus datagrid edit carat to end. #issue 493 part 3
1 parent 16ffb02 commit cf13353

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

MaterialDesignThemes.Wpf/MaterialDataGridTextColumn.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Windows;
22
using System.Windows.Controls;
3+
using System.Windows.Threading;
34

45
namespace MaterialDesignThemes.Wpf
56
{
@@ -9,9 +10,12 @@ protected override object PrepareCellForEdit(FrameworkElement editingElement, Ro
910
{
1011
var textBox = editingElement as TextBox;
1112
if (textBox != null)
13+
{
1214
textBox.MaxLength = MaxLength;
15+
textBox.SelectionStart = textBox.Text.Length;
16+
}
1317

14-
editingElement.Focus();
18+
editingElement.Focus();
1519

1620
return null;
1721
}

0 commit comments

Comments
 (0)