diff --git a/PROMS/VEPROMS User Interface/frmSectionProperties.cs b/PROMS/VEPROMS User Interface/frmSectionProperties.cs index 8af72d67..64b955e8 100644 --- a/PROMS/VEPROMS User Interface/frmSectionProperties.cs +++ b/PROMS/VEPROMS User Interface/frmSectionProperties.cs @@ -189,10 +189,13 @@ namespace VEPROMS // ppLblFormatDefault.Text = defName; // ppCmbxFormat.WatermarkText = defName; //} - _DefaultNumColumns = _SectionConfig.Section_ColumnMode.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_ColumnMode), ppLblDefaultNumColumns, ppCmbxNumColumns); - _DefaultPaginationStyle = _SectionConfig.Section_Pagination.ToString(); - SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_Pagination), ppLblDefPaginationStyle, ppCmbxSectPagination); + SectionConfig.SectionColumnMode sc = _SectionConfig.Section_ColumnMode; + _DefaultNumColumns = sc.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(sc), ppLblDefaultNumColumns, ppCmbxNumColumns); + SectionConfig.SectionPagination sp = _SectionConfig.Section_Pagination; + //Console.WriteLine("{0}, {1}, default pagination", _SectionConfig.MySection.DisplayNumber, sp); + _DefaultPaginationStyle = sp.ToString(); + SetupDefault(EnumDescConverter.GetEnumDescription(sp), ppLblDefPaginationStyle, ppCmbxSectPagination); //_DefaultPrintSize = _SectionConfig.Section_AttachmentPrintSize.ToString(); //SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_AttachmentPrintSize), ppLblDefaultPrintSize, ppCmbxAccPgPrintSize); @@ -246,17 +249,33 @@ namespace VEPROMS ppCmbxSectPagination.DisplayMember = "Description"; ppCmbxSectPagination.SelectedValueChanged -= new EventHandler(ppCmbxSectPagination_SelectedValueChanged); ppCmbxSectPagination.ValueMember = "EValue"; - ppCmbxSectPagination.SelectedValueChanged +=new EventHandler(ppCmbxSectPagination_SelectedValueChanged); ppCmbxSectPagination.SelectedIndex = -1; - ppCmbxSectPagination.SelectedValue = _SectionConfig.Section_Pagination; + SectionConfig.SectionPagination sp = _SectionConfig.Section_Pagination; + if (!(sp.ToString().Equals(_DefaultPaginationStyle))) + { + ppBtnDefaultPaginationStyle.Visible = true; + ppCmbxSectPagination.SelectedValue = sp; + } + else + ppBtnDefaultPaginationStyle.Visible = false; + + //Console.WriteLine("{0}, {1}, current pagination", _SectionConfig.MySection.DisplayNumber, ppCmbxSectPagination.SelectedValue); + ppCmbxSectPagination.SelectedValueChanged +=new EventHandler(ppCmbxSectPagination_SelectedValueChanged); ppCmbxNumColumns.DataSource = EnumDetail.Details(); ppCmbxNumColumns.DisplayMember = "Description"; ppCmbxNumColumns.SelectedValueChanged -= new EventHandler(ppCmbxNumColumns_SelectedValueChanged); ppCmbxNumColumns.ValueMember = "EValue"; - ppCmbxNumColumns.SelectedValueChanged += new EventHandler(ppCmbxNumColumns_SelectedValueChanged); ppCmbxNumColumns.SelectedIndex = -1; - ppCmbxNumColumns.SelectedValue = _SectionConfig.Section_ColumnMode; + SectionConfig.SectionColumnMode sc = _SectionConfig.Section_ColumnMode; + if (!(sc.ToString().Equals(_DefaultNumColumns))) + { + ppBtnDefaultNumColumns.Visible = true; + ppCmbxNumColumns.SelectedValue = sc; + } + else + ppBtnDefaultNumColumns.Visible = false; + ppCmbxNumColumns.SelectedValueChanged += new EventHandler(ppCmbxNumColumns_SelectedValueChanged); //ppCmbxAccPgPrintSize.DataSource = EnumDetail.Details(); //ppCmbxAccPgPrintSize.DisplayMember = "Description";