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
|
I have a DataGrid that is bound to a dynamically updated DataTable view. When the DataTable is updated with additional rows and columns the data is not initially visible, but you can see rows are being added even though they have a very small height. If I get the DataGrid out of view and then switch back to it, I can see the header data, and the rows are now the correct height, but I can't see the cell contents unless I click on it to do an edit. Although I am using the DataGrid as a view only (with editing disabled), I get a ton of errors by just hovering my mouse over cells. These results are with yesterdays nightly build. The error is : System.Windows.Data Error: 40 : BindingExpression path error: 'Timestamp (mS)' property not found on 'object' ''DataRowView' (HashCode=25736970)'. BindingExpression:Path=Timestamp (mS)[2][1]; DataItem='DataRowView' (HashCode=25736970); target element is 'ContentPresenter' (Name=''); target property is 'Content' (type 'Object'). And TimeStamp is the header of one of my columns in the DataTable. My XAML Code:
C# Code in my Code Behind:
So here is my question: What can be done to make the initial view of the DataGrid correct? I really would like to use your controls as I love your nightly build feature. I have another control from a competitor that works without issue, but I rather renew my soon to expire maintenance with Mindscape. I really hope you can help me out. P.S. I also have an installable that demonstrates this a full product, but I am not at liberty to place this in a public fourm and don't quite have the time to make a project to demonstrate the error. Ed |
|
|
Hello Ed Apologies for the delayed reply. Hope you still have time to decide to renew. I have not been able to reproduce these errors, the code you posted looks fine, and it is working at my end. I have attached a basic sample of using a DataTable as the source of a DataGrid which includes a button to dynamically add items. To run the sample, make sure to include a reference to your copy of the Mindscape.WpfElements.dll. You can use this sample to either see if there is something you are missing, or modify the sample to reproduce the problem and send it back to me if it doesn't take long. Some other questions that may help us find the issue: What dynamic operations are causing these errors? Adding a row, removing a row, adding a column etc? Are you applying any custom display or editor templates to the columns? Also, are you adding any custom DataGridColumn objects to the Columns collection? Jason Fauchelle |
|