using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Fanfajin.MyWebControls
{
    /**//// <summary>
    /// 增强的 GridView 控件 扩展 
    /// </summary>
    [DefaultProperty("SelectedValue")]
    [ToolboxData("<{0}:MyGridView runat=server></{0}:MyGridView>")]
    public sealed class MyGridView : System.Web.UI.WebControls.GridView
    {
        公开属性成员#region 公开属性成员
        /**//// <summary>
        /// 鼠标经过时颜色
        /// </summary>      
        [Category("扩展设置")]
        [Description("鼠标经过时颜色")]
        public string MouseOverColor
        {
            get
            {
                if (ViewState["MouseOverColor"] == null)
                {
                    ViewState["MouseOverColor"] = "#9900FF";
                }
                return (string)ViewState["MouseOverColor"];
            }

            set
            {
                ViewState["MouseOverColor"] = value;
            }
        }

        /**//// <summary>
        /// 鼠标经过时颜色
        /// </summary>      
        [Category("扩展设置")]
        [Description("鼠标离开时颜色")]
        public string MouseOutColor
        {
            get
            {
                if (ViewState["MouseOutColor"] == null)
                {
                    ViewState["MouseOutColor"] = "#FFFFFF";
                }
                return (string)ViewState["MouseOutColor"];
            }

            set
            {
                ViewState["MouseOutColor"] = value;
            }
        }

        /**//// <summary>
        /// 是否启用 HighlightColor
        /// </summary>
        [Category("扩展设置")]
        [Description("是否启用 MouseOverColor")]
        public bool IsOpenMouseOverColor
        {
            get
            {
                if (ViewState["enableSelection"] == null)
                {
                    ViewState["enableSelection"] = true;
                }
                return (bool)ViewState["enableSelection"];
            }

            set
            {
                ViewState["enableSelection"] = value;
            }
        }

        /**//// <summary>
        /// 是否启用扩展
        /// </summary>
        [Category("扩展设置")]
        [Description("是否启用扩展")]
        public bool ActivePagerBar
        {
            get
            {
                if (ViewState["enableLNSeaPager"] == null)
                {
                    ViewState["enableLNSeaPager"] = true;
                }
                return (bool)ViewState["enableLNSeaPager"];
            }

            set
            {
                this.AllowPaging = value;
                ViewState["enableLNSeaPager"] = value;
            }
        }

        /**//// <summary>
        /// 默认排序(图标显示升序降序时用)
        /// </summary>
        [Category("扩展设置")]
        [Description("默认排序(图标显示升序降序时用)")]
        public SortDirection SortDirectionAlt
        {
            get
            {
                if (ViewState["sortDirection"] == null)
                {
                    ViewState["sortDirection"] = SortDirection.Ascending;
                }
                return (SortDirection)ViewState["sortDirection"];
            }

            set
            {
                ViewState["sortDirection"] = value;
            }
        }

        /**//// <summary>
        /// 默认排序字段(图标显示升序降序时用)
        /// </summary>
        [Category("扩展设置")]
        [Description("默认排序字段(图标显示升序降序时用)")]
        public string SortExpressionAlt
        {
            get
            {
                if (ViewState["sortExpressionAlt"] == null)
                {
                    ViewState["sortExpressionAlt"] = "";
                }
                return (string)ViewState["sortExpressionAlt"];
            }

            set
            {
                ViewState["sortExpressionAlt"] = value;
            }
        }

        /**//// <summary>
        /// Get or Set Image location to be used to display Ascending Sort order.
        /// </summary>
        [
        Description("降序时显示的图片URL"),
        Category("扩展设置"),
        Editor("System.Web.UI.Design.UrlEditor", typeof(System.Drawing.Design.UITypeEditor)),
        DefaultValue(""),
        ]
        public string SortDescImageUrl
        {
            get
            {
                object o = ViewState["SortImageDesc"];
                return (o != null ? o.ToString() : "");
            }
            set
            {
                ViewState["SortImageDesc"] = value;
            }
        }

        /**//// <summary>
        /// Get or Set Image location to be used to display Ascending Sort order.
        /// </summary>
        [
        Description("升序时显示的图片"),
        Category("扩展设置"),
        Editor("System.Web.UI.Design.UrlEditor", typeof(System.Drawing.Design.UITypeEditor)),
        DefaultValue(""),
        ]
        public string SortAscImageUrl
        {
            get
            {
                object o = ViewState["SortImageAsc"];
                return (o != null ? o.ToString() : "");
            }
            set
            {
                ViewState["SortImageAsc"] = value;
            }
        }


        /**//// <summary>
        /// 是否显示升序降序图标
        /// </summary>
        [
        Description("是否显示升序降序图片URL"),
        Category("扩展设置"),
        Editor("System.Web.UI.Design.UrlEditor", typeof(System.Drawing.Design.UITypeEditor)),
        DefaultValue("false"),
        ]
        public bool IsShowSortDirectionImg
        {
            get
            {
                object o = ViewState["ShowSortDirection"];
                return (o != null ? Convert.ToBoolean(o) : false);
            }
            set
            {
                ViewState["ShowSortDirection"] = value;
            }
        }

        /**//// <summary>
        /// 分页信息当前第{0}页共{1}页{2}条记录
        /// </summary>
        [Category("扩展设置")]
        [Description("分页信息当前第{0}页共{1}页{2}条记录")]
        public string PageInfo
        {
            get
            {
                if (ViewState["PageInfo"] == null)
                {
                    ViewState["PageInfo"] = "当前{0},共{1}页{2}条记录";
                }
                return (string)ViewState["PageInfo"];
            }

            set
            {
                ViewState["PageInfo"] = value;
            }
        }

        /**//// <summary>
        /// 当前页左右的数字个数(不包括智能的)
        /// </summary>
        [Category("扩展设置")]
        [Description("当前页左右的数字个数(不包括智能的)")]
        public int NumCount
        {
            get
            {
                if (ViewState["NumCount"] == null)
                {
                    ViewState["NumCount"] = 5;
                }
                return (int)ViewState["NumCount"];
            }

            set
            {
                ViewState["NumCount"] = value;
            }
        }

        /**//// <summary>
        /// 是否显示智能数字
        /// </summary>
        [Category("扩展设置")]
        [Description("是否显示智能数字")]
        public bool IsShowSmartPage
        {
            get
            {
                if (ViewState["IsShowSmartPage"] == null)
                {
                    ViewState["IsShowSmartPage"] = true;
                }
                return (bool)ViewState["IsShowSmartPage"];
            }

            set
            {
                ViewState["IsShowSmartPage"] = value;
            }
        }

        /**//// <summary>
        /// 分页信息显示在左边还是在右边
        /// </summary>
        [Category("扩展设置")]
        [Description("是否启用 HighlightColor")]
        public bool PageInfoShowLeft
        {
            get
            {
                if (ViewState["PageInfoShowLeft"] == null)
                {
                    ViewState["PageInfoShowLeft"] = true;
                }
                return (bool)ViewState["PageInfoShowLeft"];
            }

            set
            {
                ViewState["PageInfoShowLeft"] = value;
            }
        }

        /**//// <summary>
        /// 智能导航数字的第一个的倍数
        /// </summary>
        [Category("扩展设置")]
        [Description("智能导航数字的第一个的倍数")]
        public int BeiShu
        {
            get
            {
                if (ViewState["BeiShu"] == null)
                {
                    ViewState["BeiShu"] = 10;
                }
                return (int)ViewState["BeiShu"];
            }

            set
            {
                ViewState["BeiShu"] = value;
            }
        }

        /**//// <summary>
        /// 当前页的颜色
        /// </summary>      
        [Category("扩展设置")]
        [Description("当前页的颜色")]
        public string CurrentPageColor
        {
            get
            {
                if (ViewState["CurrentPageColor"] == null)
                {
                    ViewState["CurrentPageColor"] = "red";
                }
                return (string)ViewState["CurrentPageColor"];
            }

            set
            {
                ViewState["CurrentPageColor"] = value;
            }
        }

        /**//// <summary>
        /// 智能数字的颜色
        /// </summary>      
        [Category("扩展设置")]
        [Description("智能数字的颜色")]
        public string SmartPageColor
        {
            get
            {
                if (ViewState["SmartPageColor"] == null)
                {
                    ViewState["SmartPageColor"] = "#00FF00";
                }
                return (string)ViewState["SmartPageColor"];
            }

            set
            {
                ViewState["SmartPageColor"] = value;
            }
        }

        #endregion

        /**//// <summary>
        /// When using GridView in certain ways the SortDirection and SortExpression
        /// properties are sometimes left blank or never changed. When using this control,
        /// the Alt properties remedy this situation.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnSorting(GridViewSortEventArgs e)
        {
            //Handle setting up of sorting info 
            if (!String.IsNullOrEmpty(this.SortExpression))
            {
                SortExpressionAlt = e.SortExpression;
                SortDirectionAlt = e.SortDirection;
            }
            else
            {
                if (SortExpressionAlt == e.SortExpression)
                {
                    if (SortDirectionAlt == SortDirection.Ascending)
                    {
                        SortDirectionAlt = SortDirection.Descending;
                    }
                    else
                    {
                        SortDirectionAlt = SortDirection.Ascending;
                    }
                }
                else
                {
                    SortDirectionAlt = SortDirection.Ascending;
                }

                this.SortExpressionAlt = e.SortExpression;
            }

            base.OnSorting(e);
        }



        初始化在分页功能启用时显示的页导航行。#region 初始化在分页功能启用时显示的页导航行。
        /**//// <summary>
        /// 初始化在分页功能启用时显示的页导航行。
        /// </summary>
        /// <param name="row">一个 GridViewRow,表示要初始化的页导航行。 </param>
        /// <param name="columnSpan">页导航行应跨越的列数</param>
        /// <param name="pagedDataSource">一个 PagedDataSource,表示数据源。 </param>
        protected override void InitializePager(GridViewRow row, int columnSpan, PagedDataSource pagedDataSource)
        {
            string pageinfo = this.PageInfo.Replace("{0}", (pagedDataSource.CurrentPageIndex + 1).ToString()).Replace
                ("{1}", pagedDataSource.PageCount.ToString()).Replace("{2}", pagedDataSource.DataSourceCount.ToString());

            if (this.ActivePagerBar)
            {
                base.PagerTemplate = new ExtendGridViewPagerTemplate(
                    this.PageIndex,
                    this.PageCount,
                    this.PagerSettings.FirstPageText,
                    this.PagerSettings.PreviousPageText,
                    this.PagerSettings.NextPageText,
                    this.PagerSettings.LastPageText,
                    pageinfo,
                    this.NumCount,
                    this.IsShowSmartPage,
                    this.BeiShu,
                    this.PageInfoShowLeft,
                    this.SmartPageColor,
                    this.CurrentPageColor
                    );
            }
            base.InitializePager(row, columnSpan, pagedDataSource);
        }
        #endregion

        /**//// <summary>
        /// 呈现 GridView 控件之前,必须先为该控件中的每一行创建一个 GridViewRow 对象。
        /// 在创建 GridView 控件中的每一行时,将引发 RowCreated 事件。这使您可以提供一个这样的事件处理方法,
        /// 即每次发生此事件时都执行一个自定义例程(如在行中添加自定义内容)。
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRowCreated(GridViewRowEventArgs e)
        {
            //给继承者的说明 在派生类中重写 OnRowCreated 时,一定要调用基类的 OnRowCreated 方法,以便已注册的委托对事件进行接收。
            base.OnRowCreated(e);
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //If row selection is enabled then add mouse over scripts to enable on client.
                if (IsOpenMouseOverColor)
                {
                    e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor = '" + this.MouseOverColor + "';");
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor = '" + this.MouseOutColor + "';");
                }
            }
            else if (e.Row.RowType == DataControlRowType.Header && IsShowSortDirectionImg)
            {
                foreach (TableCell headerCell in e.Row.Cells)
                {
                    if (headerCell.HasControls())
                    {
                        AddSortImageToHeaderCell(headerCell);
                    }
                }
            }
        }
        //Header中加入排序的图片
        private void AddSortImageToHeaderCell(TableCell headerCell)
        {
            // 查出headerCell中的 linkButton
            LinkButton lnk = (LinkButton)headerCell.Controls[0];
            if (lnk != null)
            {
                System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
                // 设置图片的URL
                img.ImageUrl = (this.SortDirectionAlt == SortDirection.Ascending ? this.SortAscImageUrl : this.SortDescImageUrl);
                // 如果用户选择了排序,则加入排序图片
                if (this.SortExpressionAlt == lnk.CommandArgument)
                {
                    //加入一个空格
                    headerCell.Controls.Add(new LiteralControl(" "));
                    headerCell.Controls.Add(img);
                }
            }
        }
    }



    /**//// <summary>
    /// 分页导航条扩展
    /// </summary>
    class ExtendGridViewPagerTemplate : ITemplate
    {
        私有成员#region 私有成员
        int _pageIndex;//当前页    
        int _pageNumber
        {
            get
            {
                return _pageIndex + 1;
            }
            set
            {
                _pageIndex = value - 1;
            }
        }//当前页 第一页为 1
        int _pageCount;//总页数
        string _First;
        string _Prev;
        string _Next;
        string _Last;
        string _PageInfo;
        int _NumCount;
        int _Beishu = 3;

        int _StartPage;
        int _EndPage;
        int _MoreStartPage1;
        int _MoreStartPage2;
        int _MoreStartPage3;
        int _MoreEndPage1;
        int _MoreEndPage2;
        int _MoreEndPage3;
        bool _IsShowSmartPage = true;
        bool _PageInfoShowLeft = true;
        string _CurrentPageColor = "red";
        string _SmartPageColor = "#00FF00";
        #endregion

        构造函数#region 构造函数
        /**//// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="pageIndex">当前页(第一页为0)</param>
        /// <param name="pageCount">总页数</param>
        /// <param name="first">首页</param>
        /// <param name="prev">上页</param>
        /// <param name="next">下页</param>
        /// <param name="last">尾页</param>
        /// <param name="pageinfo">分页信息</param>
        /// <param name="numcount">当前页数字左右显示的数字个数</param>
        /// <param name="isShowSmartPage">是否显示智能导航数字</param>
        /// <param name="beiShu">智能导航数字的第一个的倍数</param>
        /// <param name="pageInfoShowLeft">是否左边显示分页信息</param>
        /// <param name="smartPageColor">智能数字颜色</param>
        /// <param name="currentPageColor">当前页颜色</param>
        public ExtendGridViewPagerTemplate(
            int pageIndex,
            int pageCount,
            string first,
            string prev,
            string next,
            string last,
            string pageinfo,
            int numcount,
            bool isShowSmartPage,
            int beiShu,
            bool pageInfoShowLeft,
            string smartPageColor,
            string currentPageColor
            )
        {
            _pageIndex = pageIndex;
            _pageCount = pageCount;
            _First = first;
            _Prev = prev;
            _Next = next;
            _Last = last;
            _PageInfo = pageinfo;
            _NumCount = numcount;
            _IsShowSmartPage = isShowSmartPage;
            _Beishu = beiShu;
            _PageInfoShowLeft = pageInfoShowLeft;
            _SmartPageColor = smartPageColor;
            _CurrentPageColor = currentPageColor;
        }
        #endregion

        /**//// <summary>
        /// 对象初始化时调用 
        /// </summary>
        /// <param name="container"></param>
        public void InstantiateIn(Control container)
        {
            if (_PageInfoShowLeft)
            {
                createPageInfo(container);
                createSpacer(container);
            }

            createFirstLinkButtion(container);//首页
            createSpacer(container);//空格
            createPrevLinkButton(container);//上页
            createSpacer(container);
            numericBar(container);//数字导航条
            createSpacer(container);
            createNextLinkButton(container);//下页
            createSpacer(container);
            createLastLinkButtion(container);//尾页

            if (!_PageInfoShowLeft)
            {
                createPageInfo(container);
                createSpacer(container);
            }

        }
        //成生空格
        private void createSpacer(Control container)
        {
            Literal spacer = new Literal();
            spacer = new Literal();
            spacer.Text = "&nbsp;";
            container.Controls.Add(spacer);
        }
        //生成首页按钮
        private void createFirstLinkButtion(Control container)
        {
            if (_pageIndex > 0)
            {
                LinkButton pageButton;
                pageButton = new LinkButton();
                pageButton.Text = _First;
                pageButton.CommandName = "Page";
                pageButton.CommandArgument = "1";
                container.Controls.Add(pageButton);
            }
            else
            {
                Literal temp = new Literal();
                temp.Text = "<span disabled=true>" + _First + "</span>";
                container.Controls.Add(temp);
            }
        }
        //生成上一页按钮
        private void createPrevLinkButton(Control container)
        {
            if (_pageIndex > 0)
            {
                LinkButton prevButton = new LinkButton();
                prevButton.CommandName = "Page";
                prevButton.CommandArgument = "Prev";
                prevButton.Text = _Prev;
                container.Controls.Add(prevButton);
            }
            else
            {
                Literal temp = new Literal();
                temp.Text = "<span disabled=true>" + _Prev + "</span>";
                container.Controls.Add(temp);
            }
        }
        //生成下一页按钮
        private void createNextLinkButton(Control container)
        {
            if (_pageIndex < _pageCount - 1 && _pageIndex >= 0)
            {
                LinkButton prevButton = new LinkButton();
                prevButton.CommandName = "Page";
                prevButton.CommandArgument = "Next";
                prevButton.Text = _Next;
                container.Controls.Add(prevButton);
            }
            else
            {
                Literal temp = new Literal();
                temp.Text = "<span disabled=true>" + _Next + "</span>";
                container.Controls.Add(temp);
            }
        }
        //生成尾按钮
        private void createLastLinkButtion(Control container)
        {
            if (_pageIndex < _pageCount - 1 && _pageIndex >= 0)
            {
                LinkButton pageButton;
                pageButton = new LinkButton();
                pageButton.Text = _Last;
                pageButton.CommandName = "Page";
                pageButton.CommandArgument = _pageCount.ToString();
                container.Controls.Add(pageButton);
            }
            else
            {
                Literal temp = new Literal();
                temp.Text = "<span disabled=true>" + _Last + "</span>";
                container.Controls.Add(temp);
            }

        }
        //生成数字按钮
        private void createNumericPageButton(Control container, int pageIndex, bool isSmatrPage)
        {

            string _text = (pageIndex + 1).ToString();
            if (isSmatrPage)
            {
                _text = "<font color=\"" + this._SmartPageColor + "\">" + _text + "</font>";
            }
            if (pageIndex == _pageIndex)
            {
                _text = "<font color=\"" + this._CurrentPageColor + "\"><b>" + _text + "</b></font>";
            }
            LinkButton pageButton;
            pageButton = new LinkButton();
            pageButton.Text = _text;
            pageButton.CommandName = "Page";
            pageButton.CommandArgument = (pageIndex + 1).ToString();
            container.Controls.Add(pageButton);
        }

        private void numericBar(Control container)
        {

            跟据 _NumCount 计算出导航条的 起始位置与结束位置#region 跟据 _NumCount 计算出导航条的 起始位置与结束位置
            //如果总页数 小于或等于 导航条的数字个数,则把所有页码显示出来
            if (_pageCount <= _NumCount * 2 + 1)
            {
                _StartPage = 1;
                _EndPage = _pageCount;
            }
            else
            {
                if (_pageNumber <= _NumCount + 1)
                {
                    _StartPage = 1;
                    _EndPage = _NumCount * 2 + 1;
                }
                else
                {
                    if (_pageCount <= _pageNumber + _NumCount)
                    {
                        //显示最后 x*2+1页
                        _StartPage = _pageCount - _NumCount * 2;
                        _EndPage = _pageCount;
                    }
                    else
                    {
                        //正常显示
                        _StartPage = _pageNumber - _NumCount;
                        _EndPage = _pageNumber + _NumCount;
                    }
                }
            }
            #endregion

            输出前N页#region 输出前N页
            if (_IsShowSmartPage)
            {

                _MoreStartPage1 = _StartPage - _Beishu - 1;
                _MoreStartPage2 = _StartPage - _Beishu * 10 - _Beishu - 1;
                _MoreStartPage3 = _StartPage - _Beishu * 100 - _Beishu * 10 - _Beishu - 1;
                if (_MoreStartPage1 > 0)
                {
                    if (_MoreStartPage3 > 0)
                    {
                        createNumericPageButton(container, _MoreStartPage3, true);
                        createSpacer(container);
                    }
                    if (_MoreStartPage2 > _NumCount * 4)
                    {
                        createNumericPageButton(container, _MoreStartPage2, true);
                        createSpacer(container);
                    }
                    else
                    {
                        if (_MoreStartPage2 > 0)
                        {
                            createNumericPageButton(container, _MoreStartPage2, true);
                            createSpacer(container);
                        }
                    }
                    createNumericPageButton(container, _MoreStartPage1, true);
                    createSpacer(container);
                }

            }
            #endregion

            输出正常数字#region 输出正常数字
            for (int i = _StartPage - 1; i < _EndPage; i++)
            {
                createNumericPageButton(container, i, false);
                createSpacer(container);
            }
            #endregion

            输出后N页#region 输出后N页
            _MoreEndPage1 = _EndPage + _Beishu - 1;
            _MoreEndPage2 = _EndPage + _Beishu * 10 + _Beishu - 1;
            _MoreEndPage3 = _EndPage + _Beishu * 100 + _Beishu * 10 + _Beishu - 1;
            if (_MoreEndPage1 < _pageCount)
            {
                createNumericPageButton(container, _MoreEndPage1, true);
                createSpacer(container);
                if (_MoreEndPage2 < _pageCount - _NumCount * 4)
                {
                    createNumericPageButton(container, _MoreEndPage2, true);
                    createSpacer(container);
                    if (_MoreEndPage3 < _pageCount)
                    {
                        createNumericPageButton(container, _MoreEndPage3, true);
                        createSpacer(container);
                    }
                }
                else
                {
                    if (_MoreEndPage2 < _pageCount)
                    {
                        createNumericPageButton(container, _MoreEndPage1, true);
                        createSpacer(container);
                    }
                }

            }
            #endregion
        }

        private void createPageInfo(Control container)
        {
            Literal pageinfo = new Literal();
            pageinfo = new Literal();
            pageinfo.Text = _PageInfo;
            container.Controls.Add(pageinfo);
        }
    }

}

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ViewState["SelectCmd"] != null)
        {
            SqlDataSource1.SelectCommand = (string)ViewState["SelectCmd"];
            MyGridView1.DataBind();
        }
        
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        ViewState["SelectCmd"] = "SELECT [tid], [fid], [iconid], [typeid] FROM [Forum_123_topics] where tid>10";
        SqlDataSource1.SelectCommand = (string)ViewState["SelectCmd"];
        MyGridView1.DataBind();
        Response.Write(SqlDataSource1.SelectCommand);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        ViewState["SelectCmd"] = "SELECT [tid], [fid], [iconid], [typeid] FROM [Forum_123_topics]";
        SqlDataSource1.SelectCommand = (string)ViewState["SelectCmd"];
        MyGridView1.DataBind();
        Response.Write(SqlDataSource1.SelectCommand);
    }
}

转载于:https://www.cnblogs.com/fanfajin/archive/2007/08/21/864566.html

GridView 简单扩展相关推荐

  1. 简单扩展shiro 实现NOT、AND、OR权限验证(支持复杂一点的表达式)

    2019独角兽企业重金招聘Python工程师标准>>> 简单扩展shiro 实现NOT.AND.OR权限验证(支持复杂一点的表达式) .https://my.oschina.net/ ...

  2. Log4net创建日志及简单扩展

    1.概述 log4net是.Net下一个非常优秀的开源日志记录组件.log4net记录日志的功能非常强大.它可以将日志分不同的等级,以不同的格式,输出到不同的媒介.本文主要是介绍如何在Visual S ...

  3. 安卓学习第14课——GridView(简单图片浏览器1)

    今天学习的是GridView组件,利用的部分只是还是Adapter.imageView的知识,制作了简单图片浏览器 <LinearLayout xmlns:android="http: ...

  4. GridView简单使用

    如图是效果图 今天看到看到这个代码发现一个问题  就是我的listView的布局不对  我的GridView的 android:layout_height="wrap_content&quo ...

  5. C# AutoMapper的简单扩展

    AutoMapper可以很方便的将一个实体的属性值转化给另一个对象.这个功能在我们日常的编码中经常会遇到.我将AutoMapper的一些基本映射功能做成扩展方法,在编码中更方便使用. using Sy ...

  6. weex componet 简单扩展

    weex 调用componet <template> <div class="wrapper"> <test class="test&quo ...

  7. GridView简单创建序号列

    在gridview中添加模板列,并在模板列中放入lable使用Container.DataItemIndex绑定text属性,需要注意,DataItemIndex是从0开始.如下代码:  <as ...

  8. gridview 简单的分页

    allowpaging 设为 true 然后 后台代码为: protected void GridView1_PageIndexChanging(object sender, GridViewPage ...

  9. android仿微信发布动态功能,Android GridView扩展仿微信微博发图动态添加删除图片功能.pdf...

    Android GridView扩扩展展仿仿微微信信微微博博发发图图动动态态添添加加删删除除图图片片功功能能 这篇文章主要为大家详细介绍了Android GridView扩展仿微信微博发图动态添加删除 ...

最新文章

  1. Httprunner生成Allure格式HTML报告
  2. Linux 内核定时器使用 一 低精度定时器
  3. Linq(筛选与排序)
  4. Visual Studio Code(VS Code)入门
  5. Bailian2946 玩游戏【模拟】
  6. ambari 2.7 下安装httpfs
  7. 英文字母的ASCII码值
  8. 阿里热修复Sophix
  9. 2022-2028年中国通信大数据行业深度调研及投资前景预测报告
  10. A1008 Elevater(20)
  11. maven-replacer-plugin 静态资源打包方案js css
  12. 字节跳动后端开发实习生面试经验
  13. node-red教程7.3 常见的显示型仪表板控件应用
  14. Android camera2对焦设置
  15. oracle系统试算平衡表,oracle数据库中常用的系统表
  16. 加湿器-香薰机的设计方案(单片机程序+PCB)超声波震荡方式 原理图+PCB+源代码+详细设计说明
  17. 圆角头像剪裁php,PHP与JS实现头像剪裁功能架构总结
  18. xmind转Excel测试用例
  19. javascript怎么隐藏显示div
  20. 路由与交换技术期末上机考核

热门文章

  1. 分享一些笔记本电脑日常保养技巧
  2. SQL语句大全,所有的SQL都在这里 !极度建议收藏...
  3. MVC实现实现文件流打包成压缩包
  4. 360浏览器打不开微信的连接服务器,上午还能打开,下午360浏览器打不开微信公 – 手机爱问...
  5. Maven 强制导入jar包
  6. 昆虫繁殖_“专为昆虫而生” –好奇!
  7. 单选按钮步骤流程向导 js_创建令人愉快的按钮的6个步骤
  8. axios怎么封装,才能提升效率?
  9. 利用Flutter写一个跨平台的果核APP(3)——网络请求
  10. MySQL服务读取参数文件my.cnf的规律研究探索