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

Virtual Scrolling with Customized Cells

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Kucharski
Top achievements
Rank 1
David Kucharski asked on 24 Jun 2011, 04:00 PM
Hello,

I am very new to the RadGrid control. I am trying to implement the Virtual Scrolling feature. All the examples I see use a datasource that is pretty simple. I have a datasource that is a select statement pretty simple. The issue comes in the results. On some records, if a value in one of the columns equals a certain value then I want that cell to show a checkbox. If the same column has a value of a different value then I want the cell to show an image.

Are there examples of the Virtual Scrolling where the system has to go through each record before displaying to set the cell type correctly?

Thanks

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 29 Jun 2011, 11:55 AM
Hello David,

Once the grid structure is built, you cannot change the structure and type of columns. Therefore, a possible approach would be to use template columns which contain all controls that could be displayed and switch their visibility according to the data being passed in the ItemDataBound event of the grid.

You could use this help articles as a reference on how to access parts of the grid control in code-behind:
Accessing cells and rows
(accessing controls inside a template column is performed using the FindControl() method instead of indexing of the Controls[] collection.

Additionally, make sure that all rows in all pages have the same height for the scroll position to be properly calculated when using virtual scrolling.

Kind regards,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
David Kucharski
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or