using Comal.Classes; using InABox.Core; using InABox.DynamicGrid; namespace PRSDesktop { internal class CustomerGrid : DynamicDataGrid { public CustomerGrid() { ActionColumns.Add(new DynamicScheduleEditorColumn()); HiddenColumns.Add(x => x.ActiveSchedules); ; ActionColumns.Add(new DynamicMapColumn(this, x => x.Delivery.Location)); // HiddenColumns.Add(x => x.Delivery.Location.Timestamp); //HiddenColumns.Add(x => x.Delivery.Location.Latitude); //HiddenColumns.Add(x => x.Delivery.Location.Longitude); } protected override void DoReconfigure(FluentList options) { base.DoReconfigure(options); options.BeginUpdate(); options.AddRange( DynamicGridOption.SelectColumns, DynamicGridOption.MultiSelect, DynamicGridOption.FilterRows, DynamicGridOption.ExportData, DynamicGridOption.AddRows, DynamicGridOption.EditRows, DynamicGridOption.DeleteRows ); options.EndUpdate(); } public Customer[] Customers { get; private set; } //private bool HasLocation(int row) //{ // if (row.Equals(-1)) // return true; // DateTime dt = Data.Rows[row].Get(x => x.Delivery.Location.Timestamp); // return !dt.IsEmpty(); //} //private BitmapImage MapImage(int row) //{ // return HasLocation(row) ? PRSDesktop.Resources.milestone.AsBitmapImage() : null; //} //private bool MapClick(DataRow row) //{ // int index = Data.Rows.IndexOf(row); // if (HasLocation(index)) // { // MapForm form = new MapForm(row.Get(x => x.Delivery.Location.Latitude), row.Get(x => x.Delivery.Location.Longitude)); // form.ShowDialog(); // } // return false; //} } }