Datagrid.Items.GetItemsAt in Telerik RadGridView

2 posts, 1 answers
  1. Noah
    Noah avatar
    2 posts
    Member since:
    Oct 2018

    Posted 14 Jun Link to this post

    Hello, I am trying to convert my existing C# program from the real Microsoft WPF components to the Telerik components. Now I have the problem that I use the function DataGrid.Items.GetItemAt with the Microsoft components. What is the equivalent in Telerik RadGridView?

    Thank you in advance

  2. Answer
    Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1217 posts

    Posted 14 Jun Link to this post

    Hi Noah,

    The closest equivalent should be RadGridView.Items[index]. DataitemCollection has the following indexer that operates with the internal collection view, polling the items from it:
    public object this[int index]
        {
            get
            {
                if (!this.EnsureCollectionView())
                    throw new InvalidOperationException("No collection");
     
                if (!this.IsLoading)
                {
                    if (index >= 0 && index < this.CollectionView.Count)
                    {
                        return this.CollectionView.GetItemAt(index);
                    }
                }
     
                return null;
            }
            set
            {
                this.EnsureIsUsingInternalView();
                this.InternalView[index] = value;
            }
        }


    Regards,
    Ivan Ivanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top