Calling groupdescriptor reset causes the scroll to reset to the top

5 posts, 0 answers
  1. Manoj
    Manoj avatar
    15 posts
    Member since:
    Mar 2014

    Posted 09 Apr 2015 Link to this post

    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.

  2. Manoj
    Manoj avatar
    15 posts
    Member since:
    Mar 2014

    Posted 09 Apr 2015 in reply to Manoj Link to this post

    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.
  3. Manoj
    Manoj avatar
    15 posts
    Member since:
    Mar 2014

    Posted 09 Apr 2015 in reply to Manoj Link to this post

    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>

  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Apr 2015 Link to this post

    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.

     
  5. Manoj
    Manoj avatar
    15 posts
    Member since:
    Mar 2014

    Posted 13 Apr 2015 in reply to Dimitrina Link to this post

    Thanks! I am reseting the scroll position to handle this issue.
Back to Top