/// <summary> /// Raises the SaveLayout event handler to save the grid's column width and ordering. /// Requires that PopulateGrid() has been called before /// </summary> /// <returns>true if an event handler is installed</returns> public bool RaiseSaveLayout() { GridLayoutEventArgs args = new GridLayoutEventArgs(this, this.LayoutId); try { this.SavingLayout?.Invoke(this, args); if (!args.Handled) { DefaultSavingLayout?.Invoke(this, args); } } catch { } return(args.Handled); }
/// <summary> /// Raises the LoadLayout event. Requires that PopulateGrid() has been called before /// </summary> /// <returns>true if an eventhandler is installed </returns> public bool RaiseLoadLayout() { GridLayoutEventArgs args = new GridLayoutEventArgs(this, this.LayoutId); try { XGridView view = this.MainView as XGridView; view?.SaveInitialLayout(); this.LoadingLayout?.Invoke(this, args); if (!args.Handled && this.AllowDefaultLoadingLayout) { DefaultLoadingLayout?.Invoke(this, args); } } catch { } return(args.Handled); }