コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 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;
     }
 }
コード例 #4
0
        // 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);
            }
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        public override async Task LoadToDgv <Tentity, Tsearch>(DataGridList dgv, Dictionary <string, object> filters)
        {
            var response = await CreateDGVModel(dgv, filters);

            dgv.BindData(response);
        }