Let me start by saying I am new to DevTools and I have searched for several hours trying to find the answers to these questions. So here I am asking questions that probably have been answered elsewhere. If so just point me in the right direction.
I have an application that presents potentially large tables of read-only data to a user from a SQL Server 2012 database. The problem is that new rows are continually being added to the table and occasionally arbitrary rows in the table change due to external updates to the underlying database. I have external notification via a SQL Query Notification system when specific rows change or when new data is added to the table but I don't know how to best get these changes to the user interface.
I have a nice demo program running using a VirtualQueryableCollectionView linked to a wizard generated ADO.NET Entity Data Model object that becomes the DataContext for a RadGridView control. This code is almost directly copied from the Data Virtualization help. It seems to do a good job of paging through the table without excessive queries and without holding everything in memory. See the following code snips:
Question 1: How do I trigger an update to the VirtualQueryableCollectionView and the RadGridView when new rows are added to the associated table without resetting the RadGridView and without re-querying rows that are already in the collection? One problem I want to avoid is that when a user is scrolling through the items in the RadGirdView using the up and down arrows I don't want the scroll position to reset every time a new row is added to the table. This system adds 1 row to the table every second.
Question 2: How can I update an item in the collection when the item changes in the table without re-querying a page of data or reseting the RadGridView? I already have the updated item data so all I really need to do is determine if the changed item is cached in the collection and update it. Also if the updated item is visible it needs to be updated in the RadGridView.
Question 3: This should be easy but I just haven't found the answer yet. Given the system described above, how do I scroll the RadGridView to make an arbitrary row in the underlying table visible? In this case I don't care about resetting the control or re-querying data. This only happens in response to a user action and it can take more time and resources to accomplish.
I don't require any automatic monitoring of database changes since I already have a change notification system built into my programs. All I need is to update the controls to be aware of the changes.
Thanks in advance,
Jesse
I have an application that presents potentially large tables of read-only data to a user from a SQL Server 2012 database. The problem is that new rows are continually being added to the table and occasionally arbitrary rows in the table change due to external updates to the underlying database. I have external notification via a SQL Query Notification system when specific rows change or when new data is added to the table but I don't know how to best get these changes to the user interface.
I have a nice demo program running using a VirtualQueryableCollectionView linked to a wizard generated ADO.NET Entity Data Model object that becomes the DataContext for a RadGridView control. This code is almost directly copied from the Data Virtualization help. It seems to do a good job of paging through the table without excessive queries and without holding everything in memory. See the following code snips:
EntityConnectionStringBuilder ecb =
new
EntityConnectionStringBuilder();
ecb.Provider =
"System.Data.SqlClient"
;
ecb.ProviderConnectionString = Database.MakeDataSource(
"DR1Search-bab33c3e-7117-4405-ad58-7b5f6fbfa4cd"
);
var entity =
new
MeasurementsEntities(ecb.ConnectionString);
var query = entity.MeasurementPoints.OrderBy(o => o.MeasurementID);
var view =
new
VirtualQueryableCollectionView(query) { LoadSize = 50 };
DataContext = view;
<
telerik:RadGridView
Name
=
"radGridView1"
ColumnWidth
=
"*"
DataLoadMode
=
"Asynchronous"
ItemsSource
=
"{Binding}"
Margin
=
"0,45,0,0"
/>
Question 1: How do I trigger an update to the VirtualQueryableCollectionView and the RadGridView when new rows are added to the associated table without resetting the RadGridView and without re-querying rows that are already in the collection? One problem I want to avoid is that when a user is scrolling through the items in the RadGirdView using the up and down arrows I don't want the scroll position to reset every time a new row is added to the table. This system adds 1 row to the table every second.
Question 2: How can I update an item in the collection when the item changes in the table without re-querying a page of data or reseting the RadGridView? I already have the updated item data so all I really need to do is determine if the changed item is cached in the collection and update it. Also if the updated item is visible it needs to be updated in the RadGridView.
Question 3: This should be easy but I just haven't found the answer yet. Given the system described above, how do I scroll the RadGridView to make an arbitrary row in the underlying table visible? In this case I don't care about resetting the control or re-querying data. This only happens in response to a user action and it can take more time and resources to accomplish.
I don't require any automatic monitoring of database changes since I already have a change notification system built into my programs. All I need is to update the controls to be aware of the changes.
Thanks in advance,
Jesse