HI,
I am using xamgrid for WPF.
Xamgrid has CellEnteredEditMode event where I can do something with the editor which define in the XAML. In my case, it is a simple textbox and I would like to change the text. But this object has empty text(looks like the binding was not applied yet) and setting something new doesn't appear on the UI.
So you have any idea how to solve this?
Hello Boris,
My team and I have done an initial investigation of this, and I believe we may need a little more information from you on the way that your XamGrid cell in question is set up in this case before beginning work on a sample project to try to reproduce this issue on our end. Would it be possible for you to please provide some information regarding the following?
1. Are you using a TemplateColumn or perhaps something else to place your TextBox in the XamGrid?
2. How is your TextBox.Text property bound to the underlying data item value? Would it be possible for you to provide the binding you are using, if any exists?
3. In the CellEnteredEditMode event, what is the code you are using to try to set the Text on the element that you are obtaining?
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
Sorry for the late, But look like I found a solution.
protected override void OnCellEnteredEditMode(Cell cell, FrameworkElement editor)
{
base.OnCellEnteredEditMode(cell, editor);
var control = editor;
if (control != null)
control.Dispatcher.BeginInvoke((Action)(() =>
control.Focus();
//Let's try to find a control with the first editable content
var textBox = control as System.Windows.Controls.TextBox;
if (textBox != null)
if (_cellTextInput != null)
textBox.CaretIndex = textBox.Text.Length;
}
}), DispatcherPriority.ContextIdle);