private async Task <HsborsResponse <List <Purchase> > > CreateDGVModel(DataGridList dgv, Dictionary <string, object> filters) { var filter = filters.ToRequestEntity <SearchPurchaseRequest>(dgv); HsborsResponse <List <Purchase> > response = await Search <Purchase, SearchPurchaseRequest>(filter); dgv.InsertColumns(GetGridColumns()); return(response); }
public override async Task LoadToDgvAsList(DataGridList dgv, Dictionary <string, object> filters) { var response = await CreateDGVModel(dgv, filters); foreach (var item in response.Model) { dgv.AddEntity(item); } }
private void DataGrid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e) { if (!m_committing && e.EditAction == DataGridEditAction.Commit) { m_committing = true; DataGridList.CommitEdit(DataGridEditingUnit.Row, true); m_dataContext.ProcessPropertyChange(); m_committing = false; } }
// Forces resize on the columns in the data grid // so that they can shrink as well as grow. private void ResizeDataGridContent() { List <DataGridLength> columnWidths = DataGridList.Columns.Select(column => column.Width).ToList(); foreach (DataGridColumn column in DataGridList.Columns) { column.Width = 0; } DataGridList.UpdateLayout(); for (int i = 0; i < DataGridList.Columns.Count; i++) { DataGridList.Columns[i].Width = new DataGridLength(columnWidths[i].Value, columnWidths[i].UnitType); } }
private void isClear() { PrintName = string.Empty; PrintIC = string.Empty; DataGridList.Clear(); canClear = false; //Restart thread thread.Abort(); thread = new Thread(GetAllObjects); thread.Start(); //restart app //System.Diagnostics.Process.Start(Application.ResourceAssembly.Location); //Application.Current.Shutdown(); }
public override async Task LoadToDgv <Tentity, Tsearch>(DataGridList dgv, Dictionary <string, object> filters) { var response = await CreateDGVModel(dgv, filters); dgv.BindData(response); }