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

Grid does not refresh when grouping and sorting used

9 Answers 240 Views
GridView
This is a migrated thread and some comments may be shown as answers.
rubenhak
Top achievements
Rank 1
rubenhak asked on 28 Aug 2009, 05:14 PM
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.

9 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 31 Aug 2009, 06:25 AM
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.
0
rubenhak
Top achievements
Rank 1
answered on 31 Aug 2009, 08:16 PM
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.
0
Hristo
Telerik team
answered on 01 Sep 2009, 07:34 AM
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.
0
Herr
Top achievements
Rank 2
answered on 09 Apr 2010, 06:15 PM
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

0
Maya
Telerik team
answered on 12 Apr 2010, 02:28 PM
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.
0
Herr
Top achievements
Rank 2
answered on 12 Apr 2010, 03:19 PM
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
0
Maya
Telerik team
answered on 13 Apr 2010, 12:32 PM
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.
0
Herr
Top achievements
Rank 2
answered on 17 Apr 2010, 02:10 PM
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?
0
Thomas
Telerik team
answered on 22 Apr 2010, 08:36 AM
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.
Tags
GridView
Asked by
rubenhak
Top achievements
Rank 1
Answers by
Vlad
Telerik team
rubenhak
Top achievements
Rank 1
Hristo
Telerik team
Herr
Top achievements
Rank 2
Maya
Telerik team
Thomas
Telerik team
Share this question
or