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

custom cell replicates on scrolling radgridview

5 Answers 90 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 20 Jul 2013, 06:59 PM
i implemented custom cell as per samples of telerik. the custom cell is being assigned to specific cells only of the column istead of the entire column. for example one cell is a normal textbox while another implements customdropdownlist or customradbutton in the same column. i am  creating the custom cells in createcell event where i check for specific conditions to determine where to change cell type to be customdropdownlist.
here is part of the code that does this:

If e.Column.Name = "colResult" Then
            If e.Row.RowInfo.Index > -1 Then
   Dim dataItem As GetLastTestResultResult = DirectCast(e.Row.RowInfo.DataBoundItem, GetLastTestResultResult)
    Dim term? As Integer = dataItem.TCount
If term.HasValue AndAlso term > 0 Then
 Dim elem As New CustomDropdownCellElement(e.Column, e.Row)
                    elem.SetComboboxValue(CInt(dataItem.Result))
                    e.CellType = GetType(CustomDropdownCellElement)
                    e.CellElement = elem
end if
end if
end if

the problem is that when scrolling vertically the radgridview, the custom cells move from their row to other rows on the same column. i am not able to find a solution.

5 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Jul 2013, 06:04 AM
Hello Ali,

Thank you writing.

This functionality, to have different cell types in the same column, is not supported by our RadGridView and the cells in the columns must be from same type. This is because RadGridView is virtualized control, which means that few visual elements represent many logical elements and the visual elements are reused. And when you change the view the grid cannot know what type of cell to put if the cell are from different type. 

Do not hesitate to contact us if you have other questions.

Regards, Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ali
Top achievements
Rank 1
answered on 29 Jul 2013, 11:45 AM
thank you for your reply.
is there a wordaround or any other option to disable gridview virtualization? i'm stuck here.
0
Dimitar
Telerik team
answered on 02 Aug 2013, 01:00 PM
Hi Ali,

Thank you for writing back.

There is an option to work around the virtualization by adding one more (invisible) column that would determine the type of the editors. However, please note that showing permanent editors is a heavy and low-performant solution due to the great number of elements used and shown at once. Moreover, you have to keep track manually of what is stored by the editors in the grid cells and what data should be shown in the editors based on the cells' values. You can use the solution provided in the attached project if it suites your needs, but in general we would recommend the standard behavior of the grid where there is just one editor shown at a certain moment.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Ali
Top achievements
Rank 1
answered on 15 Sep 2013, 11:23 AM
hi,

thank you for your answer. The virtualization problem is solved after I implemented your solution in the sample you provided. But unfortunately, I am not able to use this solution because I lost theming support for the textbox inside gridview cell and also lost the normal behavior of the textbox cell. for example, the style of the custom textbox does  not look the same like the normal textbox in a textboxcolumn also when I press enter or the arrow key I cannot navigate between rows anymore. please give me more usable solution since our application is an enterprise app and we cannot afford such problems. as far as I am concluding now, that gridview virtualization has more problems than its benefits.
0
Dimitar
Telerik team
answered on 18 Sep 2013, 12:49 PM
Hello Ali,

Thank you for writing back.

As I have mentioned this case is not supported by default in RadGridView. The solution that I have provided you with is just an example of how you can achieve the the desired functionality if its limitations suit you. The case with the loosing the theming is expected as the editors are now shown all the time.

Another solution I can offer is to just change the editor instead of creating a custom cell. This is much simpler solution and will not have the performance issues the permanent editors cause. Please refer to the attached project and let me know how it works for you.

Regards,
Dimitar
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Ali
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ali
Top achievements
Rank 1
Share this question
or