public override void OnApplyTemplate() { base.OnApplyTemplate(); this._owner = this.FindParentOfType<JSGrid>(); if (this._owner != null) { this._owner._doOnDataGridAssigned(this); if (this._owner.delaidAssignPopupMenu != null) { this._owner.AssignPopupMenu(this._owner.delaidAssignPopupMenu); this._owner.delaidAssignPopupMenu = null; } if (!this._owner.alternatingRowBackgroundIsDefault) this.AlternatingRowBackground = this._owner.alternatingRowBackground; } }
public void Refresh(JSGrid grid) { if ((grid.Columns != null) && (grid.Columns.Count > 0)) { //Utl.UiThreadInvoke(new Action<JSGridConfig>((cfg) => { this.ColumnDefs.Clear(); foreach (var c in grid.Columns) { var v_itm = this.Add(); v_itm.FieldName = ((DataGridBoundColumn)c).Binding.Path.Path; v_itm.Header = c.Header as String; v_itm.Width = c.Width.Value; v_itm.Index = c.DisplayIndex; v_itm.IsChecked = c.Visibility == Visibility.Visible; } this.Sort(); //}), this); } if (this.PageSize == null) this.PageSize = grid.PageSize; }