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

Load images in cell

1 Answer 93 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pablo
Top achievements
Rank 1
Pablo asked on 13 Jul 2020, 11:33 AM

I have configured a radgridview element where we load approximately 1000 records. After loading the Database elements, I need to configure an icon column as shown in the image (IMG01). This icon is not part of the information of the database object but I load it directly to the radgridview column (IMG02). On the first item load this loop takes no more than 1 second for the 1000 items in the table.

If I make any changes and reload all the information from the database, the next execution of that loop takes about 40 seconds.

The image code IMG02 always runs after the image code IMG03.

Is there a way to improve the loading of these images in the radgridview element?

Thank you!

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Jul 2020, 12:07 PM

Hello, Cristina,

I would like to note that each update action over a cell in RadGridView will perform refresh operation of the grid. The more updates you have, the more refresh operations will be performed. This is expected to affect the performance.

The appropriate solution that I can suggest is to wrap the foreach loop in a BeginUpdate/EndUpdate block. Thus, the refresh operation will be executed only once after calling EndUpdate

            this.radGridView1.BeginUpdate();
            foreach (GridViewRowInfo row in this.radGridView1.Rows)
            {
                row.Cells[0].Value = "update";
            }
            this.radGridView1.EndUpdate();

I hope this information helps. If you need any further assistance please don't hesitate to contact me.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Tags
GridView
Asked by
Pablo
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or