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

Iterating the Grid rows and columns takes too long

6 Answers 190 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Munish
Top achievements
Rank 1
Munish asked on 01 Mar 2014, 04:55 AM
Hi 
I am iterating through the rows and columns of the grid view like this :
foreach (var row in radGridView.Items)
                    {
                        foreach (var column in HeaderInfo)
                        {
                            string sUniquename = uniqueNames[iColumn];
                            var boundColumn = radGridView.Columns[sUniquename] as GridViewBoundColumnBase;
                            if (boundColumn != null)
                            {                                string data = string.Format("{0}", boundColumn.GetValueForItem(row));}
                            iColumn += 1;}}
The thing is that its too slow ...for a grid with say 80k rows it is taking 5 minuted to complete this loop...I guess internally it is building up the rows internally as our grid has virtualization enabled.

Please suggest if something can be done on this.
                        
                    

6 Answers, 1 is accepted

Sort by
0
Munish
Top achievements
Rank 1
answered on 03 Mar 2014, 06:29 AM
Anybody got an idea on this ??
0
Yoan
Telerik team
answered on 03 Mar 2014, 05:43 PM
Hi Munish,

I am afraid I can not offer a good workaround. Generally, iterating through 80K items is a time consuming operation. Could you share a bit more details for the exact scenario that you want to get ?


Regards,
Yoan
Telerik
0
Munish
Top achievements
Rank 1
answered on 04 Mar 2014, 11:58 AM
I want the data as is displayed in the grid. Though , i have access to the view model ..i was preferring to read directly from the grid view as the columns might have converters , data format , data template applied. 

I tried creating a new radgrid in a seperate thread and setting all the content same as of the original grid. The time to access that local grid is less for same items...may be it is created with virtualisation as false.
0
Yoan
Telerik team
answered on 07 Mar 2014, 03:39 PM
Hi Munish,

This is indeed strange. Can you please try the attached sample project. Do you get the same behaviour on it? It would be great if you can modify it in order to reproduce the issue and resend it back to me.


Regards,
Yoan
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.

0
Munish
Top achievements
Rank 1
answered on 11 Mar 2014, 06:31 AM
Hi

You forgot to attach the project. Please attach the same.
0
Yoan
Telerik team
answered on 13 Mar 2014, 05:25 PM
Hello Munish,

Please excuse me for this. I am attaching the project again. 

Regards,
Yoan
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
Munish
Top achievements
Rank 1
Answers by
Munish
Top achievements
Rank 1
Yoan
Telerik team
Share this question
or