ListView only showing object name

alexestralexestr Member ✭✭

I'm about to pull my hair out. I have a dozen or so other ListViews that work just fine. I can't figure out what is different about this one. I initially had it more complicated, so I started pairing it down do see if I could isolate the issue, no luck.

XAML:

<ListView ItemsSource="{Binding ItemObsCollection, Mode=OneWay}" 
                      VerticalOptions="FillAndExpand" 
                      HasUnevenRows="true"   
                      IsPullToRefreshEnabled="False" 
                      IsGroupingEnabled="True"
                      CachingStrategy="RecycleElement" 
                      BackgroundColor="{DynamicResource accentColor}">
                <ListView.ItemTemplate>
                    <DataTemplate>

                        <ViewCell>

                            <Label Text="{Binding JobNumber}"/>
            </ViewCell>

                    </DataTemplate>
                </ListView.ItemTemplate>
</ListView>

ViewModel:

private ObservableCollection<LabeledEquipmentStatusPost> _itemObsCollection;
    public ObservableCollection<LabeledEquipmentStatusPost> ItemObsCollection
    {
        get => _itemObsCollection;
        set
        {
            if (_itemObsCollection == value) return;
            _itemObsCollection = value;
            OnPropertyChanged();
        }
    }

LabeledEquipmentStatusPost is derived from EquipmentStatusPost and you guessed it, adds a field that labels it. EquipmentStatusPost has an Int field named JobNumber

Best Answer

  • alexestralexestr ✭✭
    edited January 9 Accepted Answer

    So, as I was simplifying the xaml for this post, I saw the IsGroupingEnabled. Sure enough, eliminating that fixed the issue. I knew it was going to be something stupid simple that I was overlooking.

    I decided to post the question anyways, just in case someone else has the same problem.

Answers

  • alexestralexestr Member ✭✭
    edited January 9 Accepted Answer

    So, as I was simplifying the xaml for this post, I saw the IsGroupingEnabled. Sure enough, eliminating that fixed the issue. I knew it was going to be something stupid simple that I was overlooking.

    I decided to post the question anyways, just in case someone else has the same problem.

Sign In or Register to comment.