3 Answers, 1 is accepted
Hi John,
Currently, the RadDataGrid does not provide this functionality, so I have logged a feature request on your behalf in our feedback portal. You can follow and vote for the item and the link below:
Please find your Telerik points updated as a small sign of gratitude for your involvement.
Let me know if I can assist with anything else.
Regards,
Alex
Progress Telerik
Looking at the example app, it looks like there is a way to do this through the entry.
Is there a way to create a template column using entries? If so, here is my situation:
I have a on single tap event for when going into a numerical cell. That single tap is to prevent the need for a doubletap, is there a way to single tap into an entry (that is within the template column in the datagrid) and use the same logic to select all characters?
Here is my code for the single tap:
public
class
EditSingleClickCommand : DataGridCommand
{
private
readonly
RadDataGrid _dataGrid;
public
EditSingleClickCommand(RadDataGrid dataGrid)
{
_dataGrid = dataGrid;
Id = DataGridCommandId.CellTap;
}
public
override
bool
CanExecute(
object
parameter)
{
return
parameter
is
DataGridCellInfo;
}
public
override
void
Execute(
object
parameter)
{
DataGridCellInfo info = (DataGridCellInfo)parameter;
_dataGrid.CommandService.ExecuteDefaultCommand(DataGridCommandId.CellTap, parameter);
EditContext editContext =
new
EditContext(info, ActionTrigger.Tap,
null
);
_dataGrid.CommandService.ExecuteDefaultCommand(DataGridCommandId.BeginEdit, editContext);
}
}
Thanks in advance!
Hello John,
If you're going to move forward with TemplateColumn, this means you have access to the UI element directly and don't need to use DataGrid commands (also, the edit command will never fire for TemplateColumn as it is not an editable column).
Instead, you can use general Xamarin.Forms development techniques to interact and use the Xamarin.Forms elements inside that template.
To directly answer your question of how to perform a 'select all on focus' with a Xamarin.Forms Entry control, see this StackOvberflow thread - https://stackoverflow.com/questions/28194231/automatically-select-all-text-on-focus-xamarin/
I personally like the answer that uses Xamarin.Forms 4.2 Focus event because you won't need a custom renderer.
A word of caution
As I mentioned above, TemplateColumn was not intended or designed to be an editable cell. Its purpose is to display data that doesn't need to be edited (e.g. an Image). If you use it to act as a batch edit cell and circumvent the built-in editing features/lifecycle, you may find unexpected behavior. Please test your app carefully.
Regards,
Lance | Team Lead - US DevTools Support
Progress Telerik