private void OnViewSelected(object sender, Infragistics.Win.UltraWinGrid.AfterSelectChangeEventArgs e) { //Event handler for view selected try { this.mSelectedView = null; if (this.grdViews.Selected.Rows.Count > 0) { string viewName = this.grdViews.Selected.Rows[0].Cells["ViewName"].Value.ToString(); this.mSelectedView = this.mViews.Item(viewName); this.mSelectedView.ViewChanged += new EventHandler(OnViewChanged); OnViewChanged(null, null); } } catch (Exception) { } finally { OnValidateForm(null, null); } }
//Interface public LayoutViews(string scheduleName, Mediator mediator) { //Constructor try { this.mScheduleName = scheduleName; this.mMediator = mediator; this.mLayoutViews = new LayoutDS(); Read(); LayoutDS.ViewTableRow[] rows = (LayoutDS.ViewTableRow[]) this.mLayoutViews.ViewTable.Select("ScheduleName='" + this.mScheduleName + "' AND Active=true"); if (rows.Length > 0) { this.mActiveView = new LayoutView(rows[0].ViewName, this.mScheduleName, this.mMediator); } else { this.mActiveView = new LayoutView("Default", this.mScheduleName, this.mMediator); } this.mActiveView.ViewChanged += new EventHandler(OnViewChanged); } catch (Exception ex) { throw ex; } }