How to focus and select text in ListView
BitSmithy
2,141
Reputation points
Hello,
I have such ListView:
<ListView x:Name="lvFileList" Grid.Row="1" Margin="0,0,0,0"
HorizontalOptions="FillAndExpand" VerticalOptions="Start"
ItemsSource="{Binding FileList, Mode=TwoWay}" SelectionMode="Single"
ItemSelected="lvFileList_ItemSelected"
>
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Frame BorderColor="Blue" Padding="0,1,0,0" Margin="0,1,0,1">
<StackLayout x:Name="spListItems" Orientation="Horizontal">
<Button x:Name="btnSelectList" Width="30" Height="30"
Clicked="btnSelectList_Click"></Button>
<Entry x:Name="aaa"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
Text="{Binding Name}"
Focused="Entry_Focused"
/>
</StackLayout>
</Frame>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Now I populate ListView with data.
When ListView has generated rows I want to focus first Entry in first ListViewItem and next select text in this ENtry.
How to do such task?
Sign in to answer