I am binding a DataTable from a class to a xamDataGrid in code behind.
I am using something like: dataGrid.DataSource = MyClass.Instance.MyDataTable.DataView // singleton class
Any issues if, in my class:
1.) When I first bind (at app startup), the datatable is empty but new rows get added later on?
2.) I have MyDataTable.Clear() and then I re-populate the data.
I both the above cases, sometimes, my dataGrid does not update with new data. Also, this only happens when I run the exe directly but not in debug mode.
I am only looking for any know issues - it is possible that my problem is somewhere else.
Thanks.
Hello Jay,
I am just checking if my last reply was helpful for you.
If you require any further assistance, please do not hesitate to ask.
Hello Jay and thank you for adding details that describe the behavior.
I have put together a sample application trying to reproduce this behavior so I can investigate it further. On my side the grid is updated after the data table was updated even when the application was started from the .exe file (not in Debug mode). Could you please have a look at the attached sample and modify it to replicate your issue? A possible approach that could be useful for you is that you add one empty row to the data table at start up and set the DataRecord’s Visibility property to Collapsed in the XamDataGrid.
Here is some additional information - I never have this problem in debug mode. Only in exe mode, it happens sometimes - not every time. The DataTable in my singleton class is updated automatically every N seconds. This happens if there is no data in the datatable at startup. Subsequent events that are triggered every N seconds do not populate the grid but do populate the DataTable.
If I add rows to my DataTable at sartup and then simply update the data in them during subsequent event triggers, the problem never happens.
Hi,
I am just checking if you could provide more details for the same so I could investigate it further for you.
Hello Jay and thank you for posting!
I have been looking into your scenario and checked for an issue similar to this. It seems that such behavior was not logged in our internal system. Could you isolate this in a sample project and attached it here so I could investigate it further for you? You mentioned that this appears ‘sometimes’. Isn’t that behavior consistently reproducible in the both scenarios you have described?