Hi RubenKannemeyer-8831,
Welcome to our Microsoft Q&A platform!
We can't make the EnrtyCell focused directly. Here is a workaround that creating a custom EntryCell you can refer to.
MyEntryCell.cs
class MyEntryCell : ViewCell
{
public Label label
{
get;
set;
}
public Entry entry
{
get;
set;
}
public MyEntryCell()
{
label = new Label
{
Text = "123",
VerticalOptions = LayoutOptions.Center
};
entry = new Entry
{
HorizontalOptions = LayoutOptions.Fill
};
Grid grid = new Grid
{
ColumnDefinitions =
{
new ColumnDefinition { Width = GridLength.Auto },
new ColumnDefinition { Width = GridLength.Star },
}
};
grid.Children.Add(label, 0, 0);
grid.Children.Add(entry, 1, 0);
View = grid;
}
}
MainPage.xaml.cs
public partial class MainPage : ContentPage
{
protected async override void OnAppearing()
{
base.OnAppearing();
await Task.Delay(600);
myEntryCell.entry.Focus();
}
MyEntryCell myEntryCell;
public MainPage()
{
InitializeComponent();
myEntryCell = new MyEntryCell();
myEntryCell.label.Text = "Title";
TableView tableView = new TableView
{
Intent = TableIntent.Form,
Root = new TableRoot
{
new TableSection
{
myEntryCell
}
}
};
// ...
}
}
Regards,
Kyle
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.