Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PullToRefreshListView doesn't work correctly with grouping #647

Closed
RonZel opened this issue Nov 22, 2016 · 5 comments
Closed

PullToRefreshListView doesn't work correctly with grouping #647

RonZel opened this issue Nov 22, 2016 · 5 comments
Assignees
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️

Comments

@RonZel
Copy link

RonZel commented Nov 22, 2016

Build a example as in http://stackoverflow.com/questions/37122502/listview-group-in-uwp and switch to PullToRefreshListView:

  <Page.Resources>
        <CollectionViewSource x:Name="CVS" x:Key="CVS" IsSourceGrouped="True" />
    </Page.Resources>

<toolkit:PullToRefreshListView Background="Yellow" Foreground="Black" SelectionMode="None" ItemsSource="{Binding Source={StaticResource CVS}}">
	<toolkit:PullToRefreshListView.ItemTemplate>
		<DataTemplate>
			<StackPanel Margin="5">
				<TextBlock Text="{Binding Path=Name}" />
			</StackPanel>
		</DataTemplate>
	</toolkit:PullToRefreshListView.ItemTemplate>
	<toolkit:PullToRefreshListView.GroupStyle>
		<GroupStyle>
			<GroupStyle.HeaderTemplate>
				<DataTemplate>
					<TextBlock Text="{Binding Path=Key}" />
				</DataTemplate>
			</GroupStyle.HeaderTemplate>
		</GroupStyle>
	</toolkit:PullToRefreshListView.GroupStyle>
</toolkit:PullToRefreshListView>

... and ...

public class MyClass
{
	public string Name { get; set; }
	public bool Complete { get; set; }
}

public Page()
{
	this.InitializeComponent();

	List<MyClass> myClasses = new List<MyClass>();
	myClasses.Add(new MyClass { Name = "A", Complete = false });
	myClasses.Add(new MyClass { Name = "B", Complete = true });
	myClasses.Add(new MyClass { Name = "C", Complete = true });
	myClasses.Add(new MyClass { Name = "D", Complete = false });
	myClasses.Add(new MyClass { Name = "E", Complete = true });
	myClasses.Add(new MyClass { Name = "F", Complete = false });
	myClasses.Add(new MyClass { Name = "A", Complete = false });
	myClasses.Add(new MyClass { Name = "B", Complete = true });
	myClasses.Add(new MyClass { Name = "C", Complete = true });
	myClasses.Add(new MyClass { Name = "D", Complete = false });
	myClasses.Add(new MyClass { Name = "E", Complete = true });
	myClasses.Add(new MyClass { Name = "F", Complete = false });
	myClasses.Add(new MyClass { Name = "A", Complete = false });
	myClasses.Add(new MyClass { Name = "B", Complete = true });
	myClasses.Add(new MyClass { Name = "C", Complete = true });
	myClasses.Add(new MyClass { Name = "D", Complete = false });
	myClasses.Add(new MyClass { Name = "E", Complete = true });
	myClasses.Add(new MyClass { Name = "F", Complete = false });
	//Group the data
	var groups = from c in myClasses
				 group c by c.Complete;
	//Set the grouped data to CollectionViewSource
	CVS.Source = groups;
}

(if needed, add more data, in order to be able to scroll groups)

Pulling to refresh at the start of the list, it looks fine.
Scroll a bit down, and "Pull to Refresh and Release to Refresh" messages get lost.
Scroll even more, so that the the first group is scrolled out of window. Now pulling down will show header of the previous group instead of "Pull to Refresh and Release to Refresh" messages.

Following is seen when pulling down list when on the second group

issue

@deltakosh
Copy link
Contributor

Ping @nmetulev

@nmetulev
Copy link
Contributor

I am able to replicate this and it seems to only happen when refreshing with mouse, not with touch, can you confirm?

@RonZel
Copy link
Author

RonZel commented Nov 23, 2016

I suppose so, as I only tried on laptop using mouse.

@deltakosh deltakosh added bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ labels Nov 28, 2016
@CabuxaMapache
Copy link
Contributor

Up? I'm using this control in a project and need grouping... ;(

@nmetulev
Copy link
Contributor

#787 should fix this issue. Refreshing with mouse caused the content to scroll even when not scrolled to the top. Prevented mouse refresh when content is not scrolled to the top and set default behavior of control to disable refresh with mouse.

deltakosh added a commit that referenced this issue Jan 18, 2017
fixed pulltorefreshlistview refresh with mouse re: #647
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️
Projects
None yet
Development

No branches or pull requests

4 participants