RadGridView placing another RadGridView with in the cell cause vertical scroll bar lose position

1 Answer 22 Views
GridView
Sri
Top achievements
Rank 1
Sri asked on 16 Feb 2022, 06:35 PM
 

I have a RadGridView using cell Template have another radgrid causing vertical scroll lose postion when move horizontal scroll bar.

  

        <telerik:RadGridView Height="500" ItemsSource="{Binding XyzData}" AutoGenerateColumns="False" CanUserDeleteRows="False"
                             CanUserInsertRows="False" EditTriggers="None" CanUserSelect="False" RowIndicatorVisibility="Collapsed"
GroupRenderMode="Flat" RowHeight="18">
            <telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="A_ID" DataMemberBinding="{Binding A_Id}"/>
<telerik:GridViewDataColumn Header="DGroup" DataMemberBinding="{Binding D_Group}"/>
<telerik:GridViewDataColumn Header="UID" DataMemberBinding="{Binding U_Id}"/>
<telerik:GridViewColumn Header="Recommendation" CellTemplate="{StaticResource RecommendationItemTemplate}" />
</telerik:RadGridView.Columns>
        </telerik:RadGridView>

 last column Template have another RadGridView, when scroll horziontal scroll bar to right  and last columns comes to view sate vertical scroll bar jumping  and row height changing based  on radgrid size in cell. is their a solution not to jump vertical scroll bar keep  same postion when scroll horiziontal scroll bar. thanks

 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 21 Feb 2022, 02:31 PM

Hello Sri,

Thank you for the provided code snippet.

Although I cannot be absolutely certain without being able to replicate this at my end, I assume the reason for this behavior is the control's UI virtualization mechanism. In other words, when you scroll the cells containing the child RadGridView out of the viewport, they are recycled, and thus - the height of the row is reduced and vice versa.

If this is indeed the case, I have two suggestions:

  • You can set a fixed row height to ensure that the rows do not resize. This can be accomplished via the control's RowHeight property.
  • If this does not have a negative impact on the performance, you can set the EnableColumnVirtualization property to False.

Please let me know if any of these approaches works for you.

Sri
Top achievements
Rank 1
commented on 21 Feb 2022, 02:45 PM | edited

  • You can set a fixed row height to ensure that the rows do not resize. This can be accomplished via the control's RowHeight property.
  •      -   Can't set row height fixed because of child radgrid doesn't know the number of rows.              
  • If this does not have a negative impact on the performance, you can set the EnableColumnVirtualization property to False.
  •   - not working with row virtualization and column virtualization. Thanks
Dilyan Traykov
Telerik team
commented on 22 Feb 2022, 09:28 AM

Hello Sri,

I want to clarify that my suggestion is to set the two properties on the parent RadGridView instance. This way even if the height of the child grid exceeds the row height a ScrollViewer should be displayed and the number of rows should not be of importance.

As for the column virtualization, please specify whether you've set this to False on the parent RadGridView. If that is the case, I'm uncertain as to why it does not have any effect.

If possible, please send over a small sample project which demonstrates your setup and the issue you observe and I will gladly assist you further.
Tags
GridView
Asked by
Sri
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or