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

Calling groupdescriptor reset causes the scroll to reset to the top

4 Answers 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 09 Apr 2015, 11:18 AM

Hi,

 When ever I call GroupDescriptors.Reset() on the radgridview, the scroll bar is reset to the top.

Is there a way to avoid this.

 

I call groupdescriptor reset whenever one of the bound data changes and I need the group aggregate functions to trigger. Otherwise the aggregate function fails to update.

 

Thanks.

4 Answers, 1 is accepted

Sort by
0
Manoj
Top achievements
Rank 1
answered on 09 Apr 2015, 11:54 AM
I have switched to using the EditItem and CommitEdit on the Items property of the resultgrid and that seems to update the aggregates and also prevents scrolling.
0
Manoj
Top achievements
Rank 1
answered on 09 Apr 2015, 01:14 PM

Using EditItem and CommitEdit is causing another issue. This does not update the background color of the group header row.

Only resetting the group descriptor updates the group header row color but that cause the grid to scroll back to the top.

Can you kindly suggest a workaround?

I am using the following code to set color of the group header row based on the values in the grouped row.

 

<Style TargetType="telerik:GroupHeaderRow">
               <Setter Property="ShowGroupHeaderColumnAggregates" Value="True" />
               <Setter Property="ShowHeaderAggregates" Value="False" />
 
               <Setter Property="Background" Value="{Binding Items,Converter={StaticResource GroupConverter}}"/>
 
</Style>

0
Dimitrina
Telerik team
answered on 10 Apr 2015, 12:26 PM
Hi Manoj,

The ScrollBar is Reset as a CollectionChanged notification with action Reset is raised in that case. If the Action is Add or Remove, then it should stay as it is. 
In that way, I am afraid this behavior cannot be prevented and you should save the scroll position and then scroll back to it as suggested in this forum thread.

As to updating the GroupRow's Style, I would suggest you specifying a GroupRowStyleSelector to return the proper Style. You can check the topic on Style Selectors for more information on this.

Regards,
Dimitrina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Manoj
Top achievements
Rank 1
answered on 13 Apr 2015, 07:27 PM
Thanks! I am reseting the scroll position to handle this issue.
Tags
GridView
Asked by
Manoj
Top achievements
Rank 1
Answers by
Manoj
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or