Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

how to select an Item from a ExpandableListView?

$
0
0

I manage to download a working example of an ExpandableListView, the example work just with strings but i was trying to make it work with Items to increase my learning about them (yeah, i'm relatibly new to Xamarin).

So the question is:

How could you capture the selected child item?

Have in mind than i just need the string, i have the object in a dictionary and it would be cool if i could connect both, yeah, it's a little workarround probably but it's easier to work with at least untile i can learn how to make ExpandableListViews adapters who actualy works with items.

If you have one example of that ones it would be cool to, but i would still be missing of the way to retrieve the item

Here is the code of the function who sets all the Clickable Events.

void FnExpandableListViewClickEvents()
        {
            exLvwTiposItem.ChildClick += delegate (object sender, ExpandableListView.ChildClickEventArgs e) {
                Toast.MakeText(this, "child clicked", ToastLength.Short).Show();
        //Here i wanna know the selected string than i don't know how to obtain with the dictionary in order to return
        //The selected object
            };
            exLvwTiposItem.GroupExpand += delegate (object sender, ExpandableListView.GroupExpandEventArgs e) {

                if (e.GroupPosition != previousGroup)
                    exLvwTiposItem.CollapseGroup(previousGroup);
                previousGroup = e.GroupPosition;
            };
            exLvwTiposItem.GroupCollapse += delegate (object sender, ExpandableListView.GroupCollapseEventArgs e) {
                Toast.MakeText(this, "group collapsed", ToastLength.Short).Show();
            };

        }

Thanks in advance


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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