Grid does not refresh when grouping and sorting used

10 posts, 0 answers
  1. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 28 Aug 2009 Link to this post

    HI,

    I'm having some troubles with WPF RadGridView (v. 2009.1.312.35). I have a group description and sorting defined on one column.

    Sometimes when the underlying collection (ObservableCollection) is being changed, the grid view does not refresh. I need to click on the header of the column to make it refresh and display source elements correctly. 

    Is there a way to fix this problem?

    Thanks,
    Ruben.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 31 Aug 2009 Link to this post

    Hi Ruben,

    How the collection is changed in your case? Can you try also our latest version (Q2 SP1) instead and let us know about the result in your case?

    Kind regards,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WPF is Visual Studio 2017 Ready
  4. rubenhak
    rubenhak avatar
    58 posts
    Member since:
    Dec 2008

    Posted 31 Aug 2009 Link to this post

    Hi,

    Items are being removed by calling 
    collection.Remove(obj); 

    and added using:
    collection.Insert(obj, index); 

    I cant find the download link for the latest version. Can you please post it here?

    Thanks,
    Ruben.
  5. Hristo
    Admin
    Hristo avatar
    408 posts

    Posted 01 Sep 2009 Link to this post

    Hello Ruben,

    You can download the Q2 SP1 from Your Account->Downloads->RadControls for Silverlight.

    Please let me know if you have other questions.

    Greetings,
    Hristo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Herr
    Herr avatar
    23 posts
    Member since:
    Feb 2009

    Posted 09 Apr 2010 Link to this post

    Hi Terik team,

    I have another refreshing problem:
    -GridVieColumns: Name, Date
    -sorted by DateTimeColumn -> works fine
    -adding/deleting items from list -> works fine
    -changing the Date in another DetailsView -> works fine -> Grid updates value ok
    -> but the Grid doesn't "re-sort" by the new date!

    May-be you got a solution!?!?
    Thanks

  7. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 12 Apr 2010 Link to this post

    Hi Michael,

    The RadGridView is not aware of the of the changes made in the Row Details and that is why it does not sort according to the new edited items in the Details View. So, you need to add property RowDetailsVisibilityChanged="playersGrid_RowDetailsVisibilityChanged" in the definition of the grid view in the xaml file, which will call the method:

    private void playersGrid_RowDetailsVisibilityChanged(object sender, Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs e)
            {           
                if (this.playersGrid.Items.IsEditingItem)
                {
                    this.playersGrid.Items.CommitEdit();
                }
                this.playersGrid.Items.EditItem(e.Row.Item);            
            } 

    Thus RowDetailsView alerts the GridView for the changes and commit them, which results in correct sorting.


    Kind regards,
    Maya
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Herr
    Herr avatar
    23 posts
    Member since:
    Feb 2009

    Posted 12 Apr 2010 Link to this post

    Hi Maya,

    I did not mean the RowDetailsView, I have another view on my form.
    <window> 
    <dockpanel> 
    <radgridview dock.left > 
    <columns>...<columns/> 
    <radgridview/> 
    <MyDetailsView binding=current/>  
    ... 
    That's why I can't use the visibiltyChanged-Event
  9. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 13 Apr 2010 Link to this post

    Hello Michael,

    In your case again the idea is to make the grid aware of the changes made outside of it  and you can use two methods - EditItem (currentItem) and CommitEdit (), each one of them called when a certain event is on. 

    I am sending you a sample project, where the out-of-the-grid element is TextBox, whose data is bound to the field "Data" . The method EditItem (currentItem) is called during "TextBox_GotFocus" event and the method CommintEdit() - during "TextBox_LostFocus" event. Thus after sorting the grid according to the column "Data" and editing that field from the TextBox, when the TextBox looses focus, the grid will be sorted with the new value.

    Let me know if it helps.


    Regards,
    Maya
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  10. Herr
    Herr avatar
    23 posts
    Member since:
    Feb 2009

    Posted 17 Apr 2010 Link to this post

    Hi Maya,

    sounds good but when I try that I sometimes - and I really mean sometimes - an OpenAccess Exception:(German)
    System.AccessViolationException: Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer Speicher beschädigt ist.
       bei Telerik.OpenAccess.RT.Adonet2Generic.Impl.ConnectionImp.commit()
       bei OpenAccessRuntime.Relational.conn.LoggingConnection.commit()
       bei OpenAccessRuntime.Relational.conn.PooledConnection.commit()

    What happens inside the commit-method?
  11. Thomas
    Admin
    Thomas avatar
    590 posts

    Posted 22 Apr 2010 Link to this post

    Hello Michael,

    which database and driver are you using? Does it happen in the Visual Studio, while debugging or when running alone? Which other assemblies are involved?

    What I know about this issue is, that it basically says: Hey, I found a corrupted heap page when trying to allocate memory. The point of detection is not the point of corruption! Also, this happens in unmanaged heap areas, so managed code is not guilty... And OpenAccess is not using unmanaged heap at all (we don't have unmanaged code). It could be the database driver (ADO driver) that is causing such trouble or any other component in the process that uses unmanaged heap directly. I've personally seen such exceptions before, but they are sporadic and seem to occur only when debugging inside VS. Many assemblies get loaded then.

    Can you give us a list of modules that you find in the process when this exception occurs?

    Sincerely yours,
    Thomas
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for WPF is Visual Studio 2017 Ready