Hi Oscar,
Thanks for your interest in Syncfusion products.
Yes, you can force Data Template cell to enter edit mode
while pressing tab key. You can achieve your requirement by using
CurrentCellActivated event as follows,
Code Snippet[C#]:
void InternalGrid_CurrentCellActivated(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)
{
GridControl control = sender as GridControl;
if (control != null)
{
if (control.CurrentCell.Renderer != null)
{
UIElement element =
control.CurrentCell.Renderer.CurrentCellUIElement;
if (element != null)
{
TextBox text_box = DependencyObjectExtensions.FindElementOfType<TextBox>(element as
FrameworkElement);
if (text_box != null)
{
text_box.Focus();
//if it's a TextBox, move caret to the end.
if (text_box != null)
{
text_box.SelectionStart = text_box.Text.Length;
}
}
}
}
}
}
|
We have prepared a sample based on this and you can find the
sample under the following location,
Sample: SampleFor103961.zip
Note: In DataTemplate cell you can place any control.
But the Grid doesn’t know what kind of control present inside the DataTemplate
cell. Hence, when you press the Tab key, the data template cell is not entered
to the edit mode. By using the CurrentCellActivated event you can directly
force the control placed in cell template to enter edit mode.
Please let us know if you have any queries.
Regards,
Riyaj Ahamed I
SampleFor103961_b60bb1bd.zip