Events indicating item will slide in or out of screen

4 posts, 0 answers
  1. Neo
    Neo avatar
    2 posts
    Member since:
    Dec 2015

    Posted 28 Dec 2015 Link to this post

    Did RadListView provides the events that will be fired while items will slide in or out of screen, like PreparedContainerForItem or ClearedContainerForItem, while provided by the ListView implementation of Microsoft. I need those events to do some preprocessing or clean up works for each item, but I cannot find any document about it. Thank you
  2. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 01 Jan Link to this post

    Hello Neo,

    Thank you for contacting us! Currently RadListView does not offer such virtual methods to override. We are considering exposing such API in the future.
     If you share some details regarding the scenario you are looking to achieve we can suggest alternative solution with the existing API

    Regards,
    Tsvyatko
    Telerik
    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
  3. Neo
    Neo avatar
    2 posts
    Member since:
    Dec 2015

    Posted 06 Jan in reply to Tsvyatko Link to this post

    Hi Tsvyatko

    Thank you for your reply. yes we do need the alternative solution. Our using scenario is that all data to fill the RadListView item is encrypted, we need to execute the decrypt operation before the corresponding items are displayed on the screen. Thank you.

    Best Regard

    Neo

  4. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 11 Jan Link to this post

    Hi Neo,

    Depending on the specifics of the described scenario you can go with one of the following options:

    1. Create Decode converter for the individual display data:
    <Grid.Resources>
              <local:DecodeConverter x:Key="Converter"/>
          </Grid.Resources>
          <telerik:RadListView ItemsSource="{Binding}">
              <telerik:RadListView.ItemTemplate>
                  <DataTemplate>
                      <Grid>
                          <TextBlock Text="{Binding ID, Converter={StaticResource Converter}}"/>
                      </Grid>
                  </DataTemplate>
              </telerik:RadListView.ItemTemplate>
          </telerik:RadListView>
    public class DecodeConverter : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, string language)
            {
                //Add decode logic
                return ((int)value) + 100;
            }
     
            public object ConvertBack(object value, Type targetType, object parameter, string language)
            {
                throw new NotImplementedException();
            }
        }


    2. If the scenario requires creating of a separate decoded object create decode converter that projects datacontext to a new decoded object:
    <Grid.Resources>
        <local:DecodeConverter x:Key="Converter"/>
    </Grid.Resources>
    <telerik:RadListView ItemsSource="{Binding}">
        <telerik:RadListView.ItemTemplate>
            <DataTemplate>
                <Grid DataContext="{Binding Converter={StaticResource Converter}}">
                    <TextBlock Text="{Binding ID}"/>
                </Grid>
            </DataTemplate>
        </telerik:RadListView.ItemTemplate>
    </telerik:RadListView>


    public class DecodeConverter:IValueConverter
      {
          public object Convert(object value, Type targetType, object parameter, string language)
          {
              var data = value as Data;
     
              if (data!=null)
              {
                  return new DecodedData { ID = data.ID + 100 };
              }
     
              return null;
          }
     
          public object ConvertBack(object value, Type targetType, object parameter, string language)
          {
              throw new NotImplementedException();
          }
      }



    Regards,
    Tsvyatko
    Telerik
    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
Back to Top