protected void Page_PreRender(object sender, EventArgs e) { gvAutoGrid.PageIndex = CurrentGvPage - 1; BindGridView(PageSize); SetGridviewPage(); pnlPager.Visible = GridData != null && GridData.Any(); }
/// <summary> /// Are data valid - check /// </summary> /// <returns></returns> private async Task <bool> CheckIntegrity() { string err = ""; var mySettings = new MetroDialogSettings() { AnimateShow = true, AffirmativeButtonText = "Ok", ColorScheme = MetroDialogOptions.ColorScheme }; if (GridData.Any(pair => !pair.CanBeForeignKey(ref err))) { await this.ShowMessageAsync("Datatype problem", err, MessageDialogStyle.Affirmative, mySettings); return(false); } if (RelationshipName.Length == 0) { err = "Name of foreign key constraint is mandatory"; await this.ShowMessageAsync("Name problem", err, MessageDialogStyle.Affirmative, mySettings); return(false); } if (DesignerViewModel.ConnectionInfoViewModels.Any(t => t.RelationshipModel.Name.Equals(RelationshipName))) { err = "Name of foreign key constraint is already in use"; await this.ShowMessageAsync("Name problem", err, MessageDialogStyle.Affirmative, mySettings); return(false); } if (GridData.Count == 0) { err = "You have to specify at least one attribute pair"; await this.ShowMessageAsync("Attribute problem", err, MessageDialogStyle.Affirmative, mySettings); return(false); } return(true); }