This is a migrated thread and some comments may be shown as answers.

How to Bind ScrollStateChanged for RadDataBoundListBox ?

1 Answer 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pardeep
Top achievements
Rank 1
Pardeep asked on 19 Jul 2016, 01:17 PM

We are trying to bind a ScrollStateChanged event in RadDataBoundListBox such as :

Xaml Code :

<telerikPrimitives:RadDataBoundListBox x:Name="MessagesList">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="ScrollStateChanged">
                                <Command:EventToCommand Command="{Binding ScrollChangedCommand}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                        <telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
                            <telerikPrimitives:StackVirtualizationStrategyDefinition ReorderMode="MoveItemsUp"/>
                        </telerikPrimitives:RadDataBoundListBox.VirtualizationStrategyDefinition>
</telerikPrimitives:RadDataBoundListBox>

 

and In our ViewModel we used RelayCommand as :

 public ICommand ScrollChangedCommand
        {
            get
            {
                if (_ScrollChangedCommand == null)
                {
                    _ScrollChangedCommand = new RelayCommand<object>(ScollChatList, (param) => ScrollChangedCommandCanExecute);
                }

                return _ScrollChangedCommand;
            }
        }

        private void ScollChatList(object parameter)
        {
            ScrollStateChangedEventArgs scrollChangedEventArgs = parameter as ScrollStateChangedEventArgs;
            //if (scrollChangedEventArgs != null && scrollChangedEventArgs. == ScrollState.Scrolling)
            //{
            //}
        }

 

We are successfully able to bind this event in our ViewModel but 'scrollChangedEventArgs' value always be NULL. Any suggestion please..

Also we are trying to get either RadDataBoundListbox is scrolling upward or downward. Is it possible with RadDataBoundListBox ?

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 22 Jul 2016, 04:10 PM
Hi Pardeep,

Thank you for contacting us.

The command parameter is not related to the event args, so if you do not set/bind it to a value, it will be null. Unfortunately, the DataBoundListBox does not provide information about the scrolling direction.

Regards,
Rosy Topchiyska
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Pardeep
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Share this question
or