Example #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _relatedIdentities = TranslateUtils.StringCollectionToIntList(Body.GetQueryString("RelatedIdentities"));
            if (_relatedIdentities.Count == 0)
            {
                _relatedIdentities.Add(0);
            }
            _tableName   = Body.GetQueryString("TableName");
            _redirectUrl = StringUtils.ValueFromUrl(Body.GetQueryString("RedirectUrl"));

            if (!IsPostBack)
            {
                DdlIsHorizontal.Items[0].Value = true.ToString();
                DdlIsHorizontal.Items[1].Value = false.ToString();

                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.Text, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.TextArea, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.TextEditor, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.CheckBox, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.Radio, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.SelectOne, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.SelectMultiple, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.Date, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.DateTime, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.Image, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.Video, false));
                DdlInputType.Items.Add(InputTypeUtils.GetListItem(InputType.File, false));

                var styleInfo = TableStyleManager.GetTableStyleInfo(_tableName, string.Empty, _relatedIdentities);

                ControlUtils.SelectSingleItem(DdlInputType, styleInfo.InputType.Value);
                TbDefaultValue.Text           = styleInfo.DefaultValue;
                DdlIsHorizontal.SelectedValue = styleInfo.IsHorizontal.ToString();
                TbColumns.Text = styleInfo.Additional.Columns.ToString();

                TbHeight.Text = styleInfo.Additional.Height == 0 ? string.Empty : styleInfo.Additional.Height.ToString();
                TbWidth.Text  = styleInfo.Additional.Width;
            }

            ReFresh(null, EventArgs.Empty);
        }