Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Grid + Entry : entry does not work...

$
0
0

Hi.
I've this situation:

            var editPrezzo = new Entry();
            editPrezzo.SetBinding(Entry.TextProperty,"ImportoArt");
            editPrezzo.IsVisible = false;

            var labelNome = new Label();
            labelNome.FontSize = Library.GetFontNamedSize(NamedSize.Large, typeof(Label));
            labelNome.SetBinding(Label.TextProperty, "NomeImporto");
            labelNome.XAlign = TextAlignment.Center;
            labelNome.YAlign = TextAlignment.Center;
            labelNome.FontSize = Library.GetFontNamedSize(NamedSize.Medium, typeof(Label));

            var tapGestureRecognizer = new TapGestureRecognizer();
            tapGestureRecognizer.Tapped += (s, e) => {
                if(s.Equals(labelNome)) {
                    editPrezzo.IsVisible = true;
                    editPrezzo.InputTransparent = true;
                    labelNome.IsVisible = false;
                }
                else{
                    editPrezzo.IsVisible = false;
                    editPrezzo.InputTransparent = false;
                    labelNome.IsVisible = true;
                }
            };
            labelNome.GestureRecognizers.Add(tapGestureRecognizer);
            editPrezzo.GestureRecognizers.Add(tapGestureRecognizer);

I have these 2 controls in the same grid cell
grid.Children.Add(labelNome,1,3,0,2);
grid.Children.Add(editPrezzo,1,3,0,2);

I would like that, when I tap on labelNome, editPrezzo appears and vice versa.
infact editPrezzo appears, but I can't write anything. the keyboard does not appear and If I tap on editPrezzo, the Tap does not raise...
It seems that editPrezzo is "disabled"...

Someone can solve this problem?

Thanks
Alessandro


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>