The code now gets correct default and set values for section pagination

This commit is contained in:
John Jenko 2014-11-12 21:19:51 +00:00
parent 57bf9ddc2e
commit edf38ca662

View File

@ -189,10 +189,13 @@ namespace VEPROMS
// ppLblFormatDefault.Text = defName; // ppLblFormatDefault.Text = defName;
// ppCmbxFormat.WatermarkText = defName; // ppCmbxFormat.WatermarkText = defName;
//} //}
_DefaultNumColumns = _SectionConfig.Section_ColumnMode.ToString(); SectionConfig.SectionColumnMode sc = _SectionConfig.Section_ColumnMode;
SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_ColumnMode), ppLblDefaultNumColumns, ppCmbxNumColumns); _DefaultNumColumns = sc.ToString();
_DefaultPaginationStyle = _SectionConfig.Section_Pagination.ToString(); SetupDefault(EnumDescConverter.GetEnumDescription(sc), ppLblDefaultNumColumns, ppCmbxNumColumns);
SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_Pagination), ppLblDefPaginationStyle, ppCmbxSectPagination); 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(); //_DefaultPrintSize = _SectionConfig.Section_AttachmentPrintSize.ToString();
//SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_AttachmentPrintSize), ppLblDefaultPrintSize, ppCmbxAccPgPrintSize); //SetupDefault(EnumDescConverter.GetEnumDescription(_SectionConfig.Section_AttachmentPrintSize), ppLblDefaultPrintSize, ppCmbxAccPgPrintSize);
@ -246,17 +249,33 @@ namespace VEPROMS
ppCmbxSectPagination.DisplayMember = "Description"; ppCmbxSectPagination.DisplayMember = "Description";
ppCmbxSectPagination.SelectedValueChanged -= new EventHandler(ppCmbxSectPagination_SelectedValueChanged); ppCmbxSectPagination.SelectedValueChanged -= new EventHandler(ppCmbxSectPagination_SelectedValueChanged);
ppCmbxSectPagination.ValueMember = "EValue"; ppCmbxSectPagination.ValueMember = "EValue";
ppCmbxSectPagination.SelectedValueChanged +=new EventHandler(ppCmbxSectPagination_SelectedValueChanged);
ppCmbxSectPagination.SelectedIndex = -1; 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<SectionConfig.SectionColumnMode>.Details(); ppCmbxNumColumns.DataSource = EnumDetail<SectionConfig.SectionColumnMode>.Details();
ppCmbxNumColumns.DisplayMember = "Description"; ppCmbxNumColumns.DisplayMember = "Description";
ppCmbxNumColumns.SelectedValueChanged -= new EventHandler(ppCmbxNumColumns_SelectedValueChanged); ppCmbxNumColumns.SelectedValueChanged -= new EventHandler(ppCmbxNumColumns_SelectedValueChanged);
ppCmbxNumColumns.ValueMember = "EValue"; ppCmbxNumColumns.ValueMember = "EValue";
ppCmbxNumColumns.SelectedValueChanged += new EventHandler(ppCmbxNumColumns_SelectedValueChanged);
ppCmbxNumColumns.SelectedIndex = -1; 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<SectionConfig.AttPrintSize>.Details(); //ppCmbxAccPgPrintSize.DataSource = EnumDetail<SectionConfig.AttPrintSize>.Details();
//ppCmbxAccPgPrintSize.DisplayMember = "Description"; //ppCmbxAccPgPrintSize.DisplayMember = "Description";