Skip to content

SyncfusionExamples/How-to-get-automation-id-of-Xamarin.Forms-listview-in-renderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

How to get automation id of Xamarin.Forms listview in renderer?

This example demonstrates how to get automation id of Xamarin.Forms listview in renderer.

Sample

<StackLayout>
    <Button Text="Check AutomationID" Clicked="Button_Clicked"/>
    <local:ExtendedListView x:Name="listView" BackgroundColor="AliceBlue" AllowGroupExpandCollapse="True" 
                            AutomationId="12345"
                        ItemSpacing="3" ItemSize="70" ItemsSource="{Binding contactsinfo}">
        <local:ExtendedListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                        <Grid x:Name="grid" RowSpacing="1" >
                            <code>
                            . . .
                            . . .
                            <code>
                        </Grid>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </local:ExtendedListView.ItemTemplate>
    </local:ExtendedListView>
</StackLayout>

C#:
private void Button_Clicked(object sender, EventArgs e)
{
    DisplayAlert("Message","ListView Automation ID:" +listView.AutomationId,"ok");
}

See How to get automation id of Xamarin.Forms listview in renderer for more details.

Requirements to run the demo

Troubleshooting

Path too long exception

If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.

About

This example demonstrates how to get automation id of Xamarin.Forms listview in renderer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6

Languages