예제 #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            var objData = pgTest.SelectedObject;

            switch (cbControl.SelectedItem.ToString().ToUpper())
            {
            case "LABEL":
                _lbl   = (LabelCellGridClass)objData;
                lblobj = Newtonsoft.Json.JsonConvert.SerializeObject(_lbl);
                pgTest.SelectedObject = null;
                break;

            case "FIELD":
                _fld = (FieldCellGridClass)objData;
                break;

            case "TABLE":
                _tbl = (TableGridClass)objData;
                break;

            case "IMAGEURL":
                _imgUrl = (ImageUrlCellGridClass)objData;
                break;

            case "IMAGEBYTE":
                _imgByte = (ImageByteCellGridClass)objData;
                break;
            }
        }
예제 #2
0
        public static object GetPropertyGridObject(string controlType)
        {
            object objData = null;

            try
            {
                switch (controlType.ToUpper())
                {
                case "LABEL":
                    objData = new LabelCellGridClass();
                    break;

                case "FIELD":
                    objData = new FieldCellGridClass();
                    break;

                case "EMPTY":
                    objData = new EmptyCellGridClass();
                    break;

                case "TABLE":
                    objData = new TableGridClass();
                    break;

                case "ROW":
                    objData = new RowGridClass();
                    break;

                case "CELL":
                    objData = new CellGridCalss();
                    break;

                case "IMAGEURL":
                    objData = new ImageUrlCellGridClass();
                    break;

                case "IMAGEBYTE":
                    objData = new ImageByteCellGridClass();
                    break;

                case "IMAGESUBURL":
                    objData = new ImageSubUrlCellGridClass();
                    break;

                case "IMAGESUBBYTE":
                    objData = new ImageSubByteCellGridClass();
                    break;
                }
            }
            catch (Exception ex)
            {
            }

            return(objData);
        }