protected void Page_Load(object sender, EventArgs e)
        {
            ListId = new Guid(Request["List"]);

            var dt = new DataTable();

            dt.Columns.Add("DisplayName");
            dt.Columns.Add("FieldType");
            dt.Columns.Add("InternalName");

            foreach (SPField fld in Web.Lists[ListId].Fields)
            {
                if (!fld.Sealed && (!fld.ReadOnlyField || fld.Type == SPFieldType.Calculated) &&
                    fld.Type != SPFieldType.Attachments && fld.InternalName != "Order" &&
                    fld.Type != SPFieldType.File && fld.InternalName != "MetaInfo")
                {
                    dt.Rows.Add(new[] { fld.Title, fld.TypeShortDescription, fld.InternalName });
                }
            }

            dt.DefaultView.Sort = "DisplayName ASC";

            GvFields.DataSource = dt;
            GvFields.DataBind();
        }
        /// <summary>
        ///     Lists my work fields.
        /// </summary>
        private void ListMyWorkFields()
        {
            var dt = new DataTable();

            dt.Columns.Add("DisplayName");
            dt.Columns.Add("FieldType");
            dt.Columns.Add("InternalName");

            foreach (SPField fld in _web.Lists["My Work"].Fields)
            {
                if (!fld.Sealed && (!fld.ReadOnlyField || fld.Type == SPFieldType.Calculated) &&
                    fld.Type != SPFieldType.Attachments && fld.InternalName != "Order" &&
                    fld.Type != SPFieldType.File && fld.InternalName != "MetaInfo")
                {
                    dt.Rows.Add(new[] { fld.Title, fld.TypeShortDescription, fld.InternalName });
                }
            }

            dt.DefaultView.Sort = "DisplayName ASC";

            GvFields.DataSource = dt;
            GvFields.DataBind();
        }