Bug 35081 - Calling Grid.Focus does not set focus i.e. Grid.IsFocused is still false
Summary: Calling Grid.Focus does not set focus i.e. Grid.IsFocused is still false
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.5.2
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-10-20 05:16 UTC by FieldstrikeMobile
Modified: 2016-01-20 15:30 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description FieldstrikeMobile 2015-10-20 05:16:56 UTC


does not set Grid.IsFocused to true

Grid.IsFocused is still false.

Unsure as to whether this is by design or a bug
Comment 1 FieldstrikeMobile 2015-10-30 05:47:57 UTC
Tested on Android only
Comment 2 FieldstrikeMobile 2015-10-30 05:51:07 UTC
Becomes more usefull when trying to set Grid Background on a ListViewItem using Grid.IsFocused in the trigger. For example


                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="30"/>

                          <StackLayout Grid.Column="0">
                            <Label Text="{Binding Name}"  FontAttributes="Bold"/>
                            <Label Text="{Binding Address, Converter={StaticResource AddressToStringConverter}, ConverterParameter={StaticResource SortAdressLength}}" />

                          <custom:GridButton Grid.Column="1" Command="{Binding CustomerRecordCard}">
                            <Image Source="Info.png"/>
                            <Trigger TargetType="Grid" Property="IsFocused" Value="True">
                              <Setter Property="BackgroundColor" Value="#FCA905"/>
Comment 3 Stephane Delcroix 2016-01-20 15:30:01 UTC
You can't Focus() a grid, or any Layout, this doesn't make a lot of UI sense. That's why a call to Focus has that signature:

    public bool Focus ();

and invoking myGrid.Focus () will always returns false.