/// <summary> /// Handler for a Column's PropertyChanged event /// </summary> /// <param name="sender">The object that raised the event</param> /// <param name="e">A ColumnEventArgs that contains the event data</param> private void column_PropertyChanged(object sender, I3ColumnEventArgs e) { this.columns.ColumnModel.OnColumnPropertyChanged(e); if (this.propertyGrid != null) { this.propertyGrid.Refresh(); } }
/// <summary> /// Raises the ColumnPropertyChanged event /// </summary> /// <param name="e">A ColumnEventArgs that contains the event data</param> internal void OnColumnPropertyChanged(I3ColumnEventArgs e) { if (e.EventType == I3ColumnEventType.WidthChanged || e.EventType == I3ColumnEventType.VisibleChanged) { this.Columns.RecalcWidthCache(); } if (this.CanRaiseEvents) { if (this.Table != null) { this.Table.OnColumnPropertyChanged(e); } } }
void newColumn_PropertyChanged(object sender, I3ColumnEventArgs e) { if (e.EventType == I3ColumnEventType.WidthChanged) { I3Column newColumn = sender as I3Column; if (newColumn == null || newColumn.Tag == null) { return; } I3Column column = newColumn.Tag as I3Column; if (column == null) { return; } column.Width = newColumn.Width; } }
/// <summary> /// 列属性改变事件 /// Raises the PropertyChanged event /// </summary> /// <param name="e">A ColumnEventArgs that contains the event data</param> protected virtual void OnPropertyChanged(I3ColumnEventArgs e) { if (this.ColumnModel != null) { e.SetIndex(this.ColumnModel.Columns.IndexOf(this)); } if (this.CanRaiseEvents) { if (this.ColumnModel != null) { this.ColumnModel.OnColumnPropertyChanged(e); } if (PropertyChanged != null) { PropertyChanged(this, e); } } }