This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi There, We used April 18, 2013's nightly build and our user found a big problem for the datagrid. Here are the process for using the DataGrid: 1) We put the row header template as the following:
where DefaultTableView = DataTable.DefaultView 2) I delete a few records from the DataTable, everything looks fine (the DataGrid has one record left at this moment) 3) Add some records (16) to the DataTable, some times is fine, but some times, the cell get empty when move the cursor around the DataGrid, as attached in the images. When it is not correct, you can notice the Row header count is random, jumping from 1 to 17, some times it is in reverse order and some times, it is random. Can you fix them please? |
|
|
Any word on this? |
|
|
Hello Gordon I have not been able to reproduce this issue. A repro project would greatly help in resolving this issue. How are the items being added to the data grid? is there any threading involved? Jason Fauchelle |
|
|
Hi Jason, I tried very hard to reproduce it, even though I cannot reproduce the exactly the same thing, but I can reproduce the same exception when my application has problem. When doing the databinding, some times the following exception has appeared: "A first chance exception of type 'System.Data.RowNotInTableException' occurred in System.Data.dll System.Windows.Data Error: 17 : Cannot get 'Column13' value (type 'String') from '' (type 'DataRowView'). BindingExpression:Path=Column13; DataItem='DataRowView' (HashCode=13496158); target element is 'ContentPresenter' (Name=''); target property is 'Content' (type 'Object') RowNotInTableException:'System.Data.RowNotInTableException: This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row." (on the visual studio 2010's Output window with Debug options and enable Exception Messages) Even though I checked that every row in the table is valid. The following steps will reproduce: 1) Run the application 2)Click on delete button a few times 3) Click on Add Row button 4) You may need to alternate step2) and 3) a few times for the exceptions to happen. When this exception happening, my application is doing the described things( clean the cells when mouse over it as indicated in the image before), even though the reproducing project did not do the same thing, but it serves the purpose of reproducing the same exceptions. I tried a lot of things, but I cannot fix the problem. Really hope you can help us. We are using Apr 29th nightly build. I also tried Feb. 12th Nightly build and it is the same. Thanks Gordon |
|
|
Hi Jason, Can you reproduce it? I saw you have 6.0 out, if you have a fix, Will it be in 6.0? |
|
|
Hello Gordon Thanks for the repro project, I was able to easily reproduce the problem. I have resolved the issue of the order of the row numbers and the weirdness of moving the mouse over the cells. I still need to resolve the RowNotInTableException. This one is tricky to track down because it's just a binding error displayed in the console. I'll try fix this part today. When this is all done, the fix will be in the nightly build for both 5.1 and 6.0. Jason Fauchelle |
|
|
Hello Gordon A fix for the mouse-over-cell and row ordering issue will be available in the next nightly build of 5.1. I am yet to resolve the RowNotInTableException. Jason Fauchelle |
|
|
Any words on RowNotInTableException, Jason? I know you are busy, but since when this exception happens, the updating are extremely slow, and we are approaching to the release deadline... Thanks Gordon |
|
|
Hello Gordon I've finally found a way to resolve this issue which will be fixed in the next nightly build for 5.1. Thanks for your patience with this. Jason Fauchelle |
|
|
I'm interested to know what the solution to the problem was. Would you mind sharing? Thanks! Darrel |
|
|
Hello Darrel As you probably expect, our DataGrid uses virtualization + element recycling to help with performance. When an element is scrolled out of view or the model object is deleted, the row UI Element is added to a recycle stack and will later be picked up and displayed again as items are scrolled into view or added. When an element is taken out of the recycle stack, it is re-prepared with the new model objects that it needs to display. When an element is recycled, it wasn't being fully cleared of it's current model objects and this seemed fine and helps with performance. For the case of displaying a DataTable in the DataGrid, it turned out that the recycled elements keeping a hold of the DataRowView objects was not good. I'm not sure which point of the code was a problem, but something was triggering an operation on one of these "cached" DataRowView objects that had been deleted from the DataTable. It may have just been a simple binding trying to get a cell value. The solution was simply to clear the Content property of every cell of a row when the row element is recycled. Then nothing was keeping a hold of invalid DataRowView objects. Jason Fauchelle |
|
|
Excellent description, thanks! |
|