Ejemplo n.º 1
0
        public GridStructure(Type entity, string linkedColumn = "", string idColumn = "", GridEditStyle editStyle = GridEditStyle.None)
            : this(entity)
        {
            if (editStyle == GridEditStyle.Linked)
            {
                ColumnParser parser = new ColumnParser();
                _idColumn = parser.ColumnName(idColumn);
                _linkedColumn = parser.ColumnName(linkedColumn);
                //int columnNum = -1;
                //foreach (PropertyInfo property in _props)
                //{
                //    columnNum++;
                //    if (property.Name == _linkedColumn)
                //        break;
                //}

                this[_linkedColumn].Add("get", "getLink");
                this[_linkedColumn].Add("formatter", "formatEditLink");
                //this[_idColumn].Add("hidden", "true");

                var cookie1 = new HttpCookie("grid_id", idColumn);
                var cookie2 = new HttpCookie("grid_link", linkedColumn);

                HttpContext.Current.Response.AppendCookie(cookie1);
                HttpContext.Current.Response.AppendCookie(cookie2);
            }
        }
Ejemplo n.º 2
0
        public GridStructure(Type entity, string linkedColumn = "", string idColumn = "", GridEditStyle editStyle = GridEditStyle.None) : this(entity)
        {
            if (editStyle == GridEditStyle.Linked)
            {
                ColumnParser parser = new ColumnParser();
                _idColumn     = parser.ColumnName(idColumn);
                _linkedColumn = parser.ColumnName(linkedColumn);
                //int columnNum = -1;
                //foreach (PropertyInfo property in _props)
                //{
                //    columnNum++;
                //    if (property.Name == _linkedColumn)
                //        break;
                //}

                this[_linkedColumn].Add("get", "getLink");
                this[_linkedColumn].Add("formatter", "formatEditLink");
                //this[_idColumn].Add("hidden", "true");

                var cookie1 = new HttpCookie("grid_id", idColumn);
                var cookie2 = new HttpCookie("grid_link", linkedColumn);

                HttpContext.Current.Response.AppendCookie(cookie1);
                HttpContext.Current.Response.AppendCookie(cookie2);
            }
        }