private void Button_Click(object sender, RoutedEventArgs e) { var dataContext = ((CustomerConfigViewModel)DataContext); dataContext.AllCheckChange(); ColumnsConfig.RefreshData(); }
public void GetAllProperties_IncludingInherited_FromModel() { var columnsConfig = new ColumnsConfig(); var columns = typeof(UserRole).GetProperties() .Where(p => !p.IsVirtual() && !columnsConfig.ColumnsToIgnore.Contains(p.Name)) .ToList(); Assert.True(columns.Select(c => c.Name).Contains("RoleId")); }
public void SetItemsSource <TNode> (IList <TNode> list) { if (!(ColumnsConfig is FluentColumnsConfig <TNode>)) { throw new InvalidCastException("Type of TNode in IList<TNode> will be type TNode of FluentColumnsConfig<TNode>" + $" {typeof(TNode)} != {ColumnsConfig.GetType().GetGenericArguments().First()}"); } ItemsDataSource = list; }
private bool IsColumnInEditMode(PDColumn <TItem> column, TItem item) { // is editing current row? if (IsEditing && item == EditItem) { var editable = column.Editable; // override with dynamic config? var config = ColumnsConfig?.Find(x => x.Id == column.Id); return(config?.Editable ?? editable); } return(false); }
public DbContext(ILogger <DbContext> logger, IConfiguration config, MetricCollection metricCollection) { _logger = logger; _metricCollection = metricCollection; _connectionString = config["ConnectionString"]; _logger.LogDebug($"ConnectionString: {_connectionString}"); var metricsFile = config["MetricsFile"]; _columnsConfig = new ColumnsConfig(this, metricsFile); }
protected override async Task OnAfterRenderAsync(bool firstRender) { // If this is the first time we've finished rendering, then all the columns // have been added to the table so we'll go and get the data for the first time if (firstRender) { try { if (AutoLoad) { await GetDataAsync().ConfigureAwait(true); StateHasChanged(); } } catch (Exception ex) { await HandleExceptionAsync(ex).ConfigureAwait(true); } } // focus first editor after edit mode begins if (BeginEditEvent.WaitOne(0) && Columns.Count > 0 && EditItem != null) { // find first editable column var key = string.Empty; foreach (var column in ActualColumnsToDisplay) { var editable = column.Editable; // override with dynamic config? var config = ColumnsConfig?.Find(x => x.Id == column.Id); if (config?.Editable ?? editable) { key = column.Id; break; } } var row = ItemsToDisplay.IndexOf(EditItem); if (key != string.Empty) { await JSRuntime.InvokeVoidAsync("panoramicData.selectText", $"{IdEditPrefix}-{row}-{key}", _tableBeforeEditArgs !.SelectionStart, _tableBeforeEditArgs !.SelectionEnd).ConfigureAwait(true); BeginEditEvent.Reset(); } } }