How to add a Jump List to List View or Flow List View in Xamarin Forms

Hi, I am new in xamarin forms, I want to add a jump list feature to my list ,How can i implement this.

Here is my code

_realmList = _tmpList.OrderBy(s => s.ProjectName).Select(s => new ProjectNameDataRealm
{
jumpList = s.ProjectName.First(),
CongressionalDistrict = s.CongressionalDistrict,
Project_ID = s.Project_ID,
StateshortName = s.StateshortName,
ShortProjectname = s.ProjectName.Length > 12 ? s.ProjectName.Remove(12) + "..." : s.ProjectName,
ProjectName = s.ProjectName,
streetAddress = s.streetAddress,
city = s.city,
latitude = s.latitude,
longitude = s.longitude,
MarketType = s.MarketType,

        }).ToObservableCollection();

        GroupedData = _realmList.OrderBy(p => p.ProjectName)
       .GroupBy(p => p.ProjectName[0].ToString())
       .Select(p => new ObservableGroupCollection<string, ProjectNameDataRealm>(p)).ToList();

        if (_realmList.Any())
        {

            if (Device.RuntimePlatform == Device.Android)
            {                      
                lv_searchDroid.ItemsSource = GroupedData ;
                lv_searchDroid.IsGroupingEnabled = true;
                lv_searchDroid.GroupShortNameBinding = new Binding("Key");
                BindingContext = this;
             }
        }

I want to group the list by projectname and display the First letter at the right side.

But the above code doesn't work for me .

I want to show the jump list like this

Answers

  • igorkr_10igorkr_10 Member ✭✭✭

    Its difficult to understand your code. For first, check this article

    I am using listview in xaml:

    <ListView Grid.Row="1" 
                ItemsSource="{Binding GroupedItems}"
                VerticalOptions="FillAndExpand" 
                 HasUnevenRows="true"
                 RefreshCommand="{Binding LoadItemsCommand}"
                 IsPullToRefreshEnabled="true"
                 IsRefreshing="{Binding IsBusy, Mode=OneWay}"
                 IsGroupingEnabled="True"
                 GroupDisplayBinding="{Binding Key}"
         GroupShortNameBinding="{Binding Key}"
                 CachingStrategy="RecycleElement"
                 BackgroundColor="Transparent"
                 SeparatorVisibility="None"
                 ItemSelected="OnItemSelected">
                <ListView.GroupHeaderTemplate>
                    <DataTemplate>
                        <ViewCell Height="25">                            
                        </ViewCell>
                    </DataTemplate>
                </ListView.GroupHeaderTemplate>
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell Height="150">                            
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
    

    The jump list will be displayed only on iOS. For android you can create your own jump list OR use android specific fastscroll.

  • AswathyAswathy Member ✭✭

    @igorkr_10 I want to implement this in android ,Is there any good solution for that

Sign In or Register to comment.