Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (DropDownList1.Items.Count == 0)
            {
                if (Mode == DataBoundControlMode.Insert || !Column.IsRequired)
                {
                    DropDownList1.Items.Add(new ListItem("[Not Set]", ""));
                }
                //PopulateListControl(DropDownList1);

                SkeletonPage sPage = (SkeletonPage)Page;
                ForeignKeyManager.PopulateListControl((MetaForeignKeyColumn)Column, DropDownList1, sPage.SelectedOrganization.Id);
            }

            SetUpValidator(RequiredFieldValidator1);
            SetUpValidator(DynamicValidator1);
        }
Example #2
0
//-------------------------------------------------------------------------------------------
        protected void Page_Init(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!Column.IsRequired)
                {
                    DropDownList1.Items.Add(new ListItem("[Not Set]", NullValueString));
                }
                SkeletonPage sPage = (SkeletonPage)Page;
                ForeignKeyManager.PopulateListControl(Column, DropDownList1, sPage.SelectedOrganization.Id);
                // Set the initial value if there is one
                string initialValue = DefaultValue;
                if (!String.IsNullOrEmpty(initialValue))
                {
                    DropDownList1.SelectedValue = initialValue;
                }
            }
        }