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

Datagrid.Items.GetItemsAt in Telerik RadGridView

1 Answer 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Noah
Top achievements
Rank 1
Noah asked on 14 Jun 2019, 11:13 AM

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

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Ivanov
Telerik team
answered on 14 Jun 2019, 01:44 PM
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.
Tags
GridView
Asked by
Noah
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or