Bug 50706 - A picker in a grid in a viewcell in a tableview does not display the selected item (Windows only)
Summary: A picker in a grid in a viewcell in a tableview does not display the selected...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-12-23 07:45 UTC by Joris Zwaenepoel
Modified: 2017-07-10 09:38 UTC (History)
4 users (show)

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


Attachments
Sample project demonstrating the issue (113.61 KB, application/x-zip-compressed)
2016-12-23 07:45 UTC, Joris Zwaenepoel
Details

Description Joris Zwaenepoel 2016-12-23 07:45:02 UTC
Created attachment 18979 [details]
Sample project demonstrating the issue

A TableView control, with a ViewCell that is a Grid containing a picker.

When used in a Windows 8.1 project, and you select an item using the picker, the selected item is not displayed.
When the app is resized, the selected item appears.

When used in a UWP project, it seems to have the same behaviour, even when not used in a grid, but also in a stacklayout or directly in a viewcell.


Example XAML:

      <StackLayout>
        <TableView>
          <TableRoot>
            <TableSection>
              <ViewCell>
                <Label Text="Picker in TableView+Grid+ViewCell" />
              </ViewCell>
              <ViewCell>
                <Grid>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                  </Grid.ColumnDefinitions>
                  <Label Grid.Column="0" Text="Choose" />
                  <Picker Grid.Column="1" x:Name="pickerInGridInTableView">
                    <Picker.Items>
                      <x:String>"AAAAA"</x:String>
                      <x:String>"BBBBB"</x:String>
                      <x:String>"CCCCC"</x:String>
                    </Picker.Items>
                  </Picker>
                </Grid>
              </ViewCell>
            </TableSection>
          </TableRoot>
        </TableView>
      </StackLayout>



I just found this workaround that seems to work for me:

        private void Pckr_SelectedIndexChanged(object sender, EventArgs e)
        {
            var p = (Picker)sender;
            p.IsVisible = false;
            p.IsVisible = true;
        }
Comment 1 adrianknight89 2016-12-23 15:32:58 UTC
Considering TableView is going to go away eventually, I'm not sure if I'd expect a fix to this soon or at all.
Comment 2 E.Z. Hart [MSFT] 2017-02-14 20:13:32 UTC
This should be fixed in 2.3.5.
Comment 3 Saurabh Paunikar 2017-07-10 09:38:05 UTC
Verified on xamarin.form version 2.3.5.256-pre6

ScreenCast link : https://www.screencast.com/t/qO0ZUsINyz

Note You need to log in before you can comment on or make changes to this bug.