Hi,
I am binding a grid control (from DevExpress) using the following LINQ query:
Here is my question: The datasource for my entity context is on a remote server. I am wanting to poll that server at a specified interval using a timer. What would be the best way to run this query again and refresh the datagrid? I realize that I could simply re-run the code in the Load event, but it resets any selection/grouping/filtering etc when you set the datasource property.Code:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Linq; using System.Windows.Forms; using DevExpress.XtraEditors; namespace WindowsFormsApplication1 { public partial class frmMain : DevExpress.XtraEditors.XtraForm { Models.beachreach_dataEntities objDB = new Models.beachreach_dataEntities(); public frmMain() { InitializeComponent(); } private void frmMain_Load(object sender, EventArgs e) { gcVans.DataSource = from v in objDB.vans select new Models.clsDisplayVan { van_name = v.van_name, van_school_name = v.school.school_name, van_phone = v.phone, van_capacity = (int) v.capacity, is_offline = (int) v.is_offline, is_prayer_room = (int) v.is_prayer_room }; } }
Thanks for any assistance as I am new to the Entity Framework (mostly a LAMP dev)!




Reply With Quote
