vinick
Topic Author
Posts: 3
Joined: 19 Jul 2021, 13:42

Problem with ListBox scrolling

28 Mar 2024, 08:53

Hi all.
I have ListBox scrolling with the mouse wheel not working unless the cursor is over the ListBoxItem area.
Example:
    <Page.Resources>
        <Style x:Key="ListItemSt" 
               TargetType="ListBoxItem"> 
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid x:Name="ItemGrid" Background="Yellow" Margin="20">
                            <TextBlock Text="1" Foreground="Black"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>
    <Grid Background="Wheat">
        <ListBox ItemContainerStyle="{StaticResource ListItemSt}">
            <ListBoxItem>1</ListBoxItem>
            <ListBoxItem>2</ListBoxItem>
            <ListBoxItem>3</ListBoxItem>
	<!-- more items -->
        </ListBox> 
    </Grid>
If I remove the Margin field in "ItemGrid" the scrolling works, otherwise it only works if the mouse pointer is over the TextBlock.
What did I do wrong? Noesis version 3.1.5. In Wpf, everything works correctly.
 
User avatar
sfernandez
Site Admin
Posts: 3064
Joined: 22 Dec 2011, 19:20

Re: Problem with ListBox scrolling

28 Mar 2024, 12:44

Could you try to set the background of the ListBox to Transparent?
<ListBox Background="Transparent">
I think the problem is that our ListBox default style does not set it, we will fix it.

Who is online

Users browsing this forum: Google [Bot] and 2 guests