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

How to get cells in RadGridView?

3 Answers 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 07 Mar 2014, 04:33 AM
var firstRow = this.gridView.ItemContainerGenerator.ContainerFromIndex(0) as GridViewRow;
//var firstRow = this.gridView.GetRowForItem(this.gridView.Items[0]) as GridViewRow;
var cells = firstRow.Cells;
var firstCell = firstRow.Cells[0];

I have tried the code above, but "cells" is just provides the cells in viewable area. If I drag horizontal scrollbar to the right side and hide the first column, then I can not get the real first cell by "firstCell". Otherwise, "firstRow.Cells.Count" changes with the horizontal scrollbar scrolling.

Please help...

3 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
answered on 07 Mar 2014, 07:27 AM
Is anybody here?
0
Andy
Top achievements
Rank 1
answered on 08 Mar 2014, 01:04 AM
Hello, I'm not here right now. Please leave a message after the beep......
0
Hristo
Telerik team
answered on 11 Mar 2014, 04:20 PM
Hi Andy,

This is the expected behavior, because by default the row/column virtualization is enabled. When this function is enabled only the  visible items are created. All other visual items are created when they come into view, and removed when the items are outside the visible area. Disabling the virtualization is not recommended, because it can lead to various performance problems when large data is loaded.

The topic of UI Virtualization is discussed in greater details in this article.

Regards,
Hristo
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
GridView
Asked by
Andy
Top achievements
Rank 1
Answers by
Andy
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or