扩展GridView控件(5) - 固定指定行、指定列

设置gridview列宽(超好用) 设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽设置gridview列宽 立即下载

 

扩展GridView控件(5) - 固定指定行、指定列

 

作者:webabcd


/*正式版的实现 开始*/
介绍
扩展GridView控件:
固定指定行、指定列,根据RowType固定行,根据RowState固定行

使用方法(设置FixRowColumn复合属性):
FixRowType - 需要固定的行的RowType(用逗号“,”分隔)
FixRowState - 需要固定的行的RowState(用逗号“,”分隔)
FixRows - 需要固定的行的索引(用逗号“,”分隔)
FixColumns - 需要固定的列的索引(用逗号“,”分隔)
TableWidth - 表格的宽度
TableHeight - 表格的高度


关键代码
css
/**//*固定行*/
.yy_sgv_fixRow
{}{
    position: relative; top: expression(this.offsetParent.scrollTop - 1);
}
/**//*固定列*/
.yy_sgv_fixCol
{}{
    position: relative; left: expression(this.offsetParent.scrollLeft - 1);
}
/**//*高优先级的固定*/
.yy_sgv_fixHigh
{}{
    z-index: 9999;
}
/**//*低优先级的固定*/
.yy_sgv_fixLow
{}{
    z-index: 1000;
}
c#
using System;
using System.Collections.Generic;
using System.Text;

using System.Web.UI.WebControls;
using System.Web.UI;

namespace YYControls.SmartGridViewFunction
{
    /**//// <summary>
    /// 扩展功能:固定指定行、指定列
    /// </summary>
    public class FixRowColumnFunction : ExtendFunction
    {
        /**//// <summary>
        /// 构造函数
        /// </summary>
        public FixRowColumnFunction()
            : base()
        {

        }

        /**//// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="sgv">SmartGridView对象</param>
        public FixRowColumnFunction(SmartGridView sgv)
            : base(sgv)
        {

        }

        /**//// <summary>
        /// 扩展功能的实现
        /// </summary>
        protected override void Execute()
        {
            this._sgv.RowDataBoundCell += new SmartGridView.RowDataBoundCellHandler(_sgv_RowDataBoundCell);
            this._sgv.RenderBegin += new SmartGridView.RenderBeginHandler(_sgv_RenderBegin);
            this._sgv.RenderEnd += new SmartGridView.RenderEndHandler(_sgv_RenderEnd);
        }

        /**//// <summary>
        /// SmartGridView的RowDataBoundCell事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="gvtc"></param>
        void _sgv_RowDataBoundCell(object sender, GridViewTableCell gvtc)
        {
            TableCell tc = gvtc.TableCell;
            GridViewRow gvr = (GridViewRow)tc.Parent;

            int i = 0; // 0-既不固定行也不固定列;1-固定行或固定列;2-既固定行也固定列
            // 固定行
            if
            (
                (
                    !String.IsNullOrEmpty(this._sgv.FixRowColumn.FixRows)
                    &&
                    Array.Exists(this._sgv.FixRowColumn.FixRows.Split(','), delegate(string s) { return s == gvr.RowIndex.ToString(); })
                )
                ||
                (
                    !String.IsNullOrEmpty(this._sgv.FixRowColumn.FixRowType)
                    &&
                    Array.Exists(this._sgv.FixRowColumn.FixRowType.Split(','), delegate(string s) { return s == gvr.RowType.ToString(); })
                )
                ||
                (
                    !String.IsNullOrEmpty(this._sgv.FixRowColumn.FixRowState)
                    &&
                    Array.Exists(this._sgv.FixRowColumn.FixRowState.Split(','), delegate(string s) { return s == gvr.RowState.ToString(); })
                )
            )
            {
                i++;
                Helper.Common.SetAttribute(tc, "class", "yy_sgv_fixRow", AttributeValuePosition.Last, ' ');
            }
            // 固定列
            if
                (
                    !String.IsNullOrEmpty(this._sgv.FixRowColumn.FixColumns)
                    &&
                    Array.Exists(this._sgv.FixRowColumn.FixColumns.Split(','), delegate(string s) { return s == gvtc.ColumnIndex.ToString(); })
                )
            {
                i++;
                Helper.Common.SetAttribute(tc, "class", "yy_sgv_fixCol", AttributeValuePosition.Last, ' ');
            }

            // 低等级的z-index
            if (i == 1)
            {
                Helper.Common.SetAttribute(tc, "class", "yy_sgv_fixLow", AttributeValuePosition.Last, ' ');
            }
            // 高等级的z-index
            else if (i == 2)
            {
                Helper.Common.SetAttribute(tc, "class", "yy_sgv_fixHigh", AttributeValuePosition.Last, ' ');
            }
        }

        /**//// <summary>
        /// RenderBegin
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="writer"></param>
        void _sgv_RenderBegin(object sender, HtmlTextWriter writer)
        {
            writer.AddStyleAttribute(HtmlTextWriterStyle.Overflow, "auto");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Position, "relative");
            writer.AddStyleAttribute(HtmlTextWriterStyle.Width, String.IsNullOrEmpty(this._sgv.FixRowColumn.TableWidth) ? "100%" : this._sgv.FixRowColumn.TableWidth);
            writer.AddStyleAttribute(HtmlTextWriterStyle.Height, String.IsNullOrEmpty(this._sgv.FixRowColumn.TableHeight) ? "100%" : this._sgv.FixRowColumn.TableHeight);
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
        }

        /**//// <summary>
        /// RenderEnd
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="writer"></param>
        void _sgv_RenderEnd(object sender, HtmlTextWriter writer)
        {
            writer.RenderEndTag();
        }
    }
}
/*正式版的实现 结束*/

/*测试版的实现 开始*/
介绍
平时使用GridView的时候会有固定表头、指定行或指定列的需求,就像Excel冻结行、列那样。其实我们可以用CSS来搞定。扩展一下GridView,通过设置几个属性来达到这样的功能。


控件开发
1、新建一个继承自GridView的类,另外为了保持滚动条状态,还要继承IPostBackDataHandler接口
    /**//// <summary>
    /// 继承自GridView
    /// </summary>
    [ToolboxData(@"<{0}:SmartGridView runat='server'></{0}:SmartGridView>")]
    public class SmartGridView : GridView, IPostBackDataHandler
    {

    }

2、新建一个FixRowCol类,有七个属性
using System;
using System.Collections.Generic;
using System.Text;

using System.ComponentModel;

namespace YYControls.SmartGridView
{
    /**//// <summary>
    /// 固定表头、指定行或指定列的实体类
    /// </summary>
    [TypeConverter(typeof(ExpandableObjectConverter))]
    public class FixRowCol
    {
        private bool _isFixHeader;
        /**//// <summary>
        /// 固定表头否?
        /// </summary>
        [Description("固定表头否?"), Category("扩展"), DefaultValue(false), NotifyParentProperty(true)]
        public virtual bool IsFixHeader
        {
            get { return _isFixHeader; }
            set { _isFixHeader = value; }
        }

        private bool _isFixPager;
        /**//// <summary>
        /// 固定分页行否?
        /// </summary>
        [Description("固定分页行否?"), Category("扩展"), DefaultValue(false), NotifyParentProperty(true)]
        public virtual bool IsFixPager
        {
            get { return _isFixPager; }
            set { _isFixPager = value; }
        }

        private string _fixRowIndices;
        /**//// <summary>
        /// 需要固定的行的索引(用逗号“,”分隔)
        /// </summary>
        [Description("需要固定的行的索引(用逗号“,”分隔)"), Category("扩展"), NotifyParentProperty(true)]
        public virtual string FixRowIndices
        {
            get { return _fixRowIndices; }
            set { _fixRowIndices = value; }
        }

        private string _fixColumnIndices;
        /**//// <summary>
        /// 需要固定的列的索引(用逗号“,”分隔)
        /// </summary>
        [Description("需要固定的列的索引(用逗号“,”分隔)"), Category("扩展"), NotifyParentProperty(true)]
        public virtual string FixColumnIndices
        {
            get { return _fixColumnIndices; }
            set { _fixColumnIndices = value; }
        }

        private System.Web.UI.WebControls.Unit _tableWidth;
        /**//// <summary>
        /// 表格的宽度
        /// </summary>
        [Description("表格的宽度"), Category("扩展"), NotifyParentProperty(true)]
        public System.Web.UI.WebControls.Unit TableWidth
        {
            get { return _tableWidth; }
            set { _tableWidth = value; }
        }

        private System.Web.UI.WebControls.Unit _tableHeight;
        /**//// <summary>
        /// 表格的高度
        /// </summary>
        [Description("表格的高度"), Category("扩展"), NotifyParentProperty(true)]
        public System.Web.UI.WebControls.Unit TableHeight
        {
            get { return _tableHeight; }
            set { _tableHeight = value; }
        }

        private bool _enableScrollState;
        /**//// <summary>
        /// 是否保持滚动条的状态
        /// </summary>
        [Description("是否保持滚动条的状态"), Category("扩展"), DefaultValue(false), NotifyParentProperty(true)]
        public bool EnableScrollState
        {
            get { return _enableScrollState; }
            set { _enableScrollState = value; }
        }

        /**//// <summary>
        /// ToString();
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return "FixRowCol";
        }
    }
}

3、在继承自GridView的类中加一个复杂对象属性,该复杂对象就是第2步创建的那个FixRowCol
        private FixRowCol _fixRowCol;
        /**//// <summary>
        /// 固定表头、指定行或指定列
        /// </summary>
        [
        Description("固定表头、指定行或指定列"),
        Category("扩展"),
        DefaultValue(""),
        DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
        PersistenceMode(PersistenceMode.InnerProperty)
        ]
        public virtual FixRowCol FixRowCol
        {
            get
            {
                if (_fixRowCol == null)
                {
                    _fixRowCol = new FixRowCol();
                }
                return _fixRowCol;
            }
        }
4、重写OnRowDataBound以设置每个单元格的样式,从而实现固定表头、指定行或指定列的功能。
        /**//// <summary>
        /// OnRowDataBound
        /// </summary>
        /// <param name="e"></param>
        protected override void OnRowDataBound(GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.Pager)
            {
                if (FixRowCol.IsFixPager)
                {
                    if (this.PagerSettings.Position == PagerPosition.Top || (this.PagerSettings.Position == PagerPosition.TopAndBottom && _isTopPager))
                    {
                        // TopPager固定行和列
                        e.Row.Cells[0].Attributes.Add("style", "z-index:999; position: relative; top: expression(this.offsetParent.scrollTop); left: expression(this.offsetParent.scrollLeft);");
                        // 现在是TopPager,之后就是BottomPager了,所以设置_isTopPager为false
                        _isTopPager = false;
                    }
                    else if (this.PagerSettings.Position == PagerPosition.TopAndBottom && !_isTopPager)
                    {
                        // BottomPager只固定列
                        e.Row.Cells[0].Attributes.Add("style", "z-index:999; position: relative; left: expression(this.offsetParent.scrollLeft);");
                        // 现在是BottomPager,之后就是TopPager了,所以设置_isTopPager为true
                        _isTopPager = true;
                    }
                }
            }

            if (e.Row.RowType == DataControlRowType.DataRow || e.Row.RowType == DataControlRowType.Header)
            {
                // 给每一个指定固定的列的单元格加上css属性
                if (!String.IsNullOrEmpty(FixRowCol.FixColumnIndices))
                {
                    // 列索引
                    foreach (string s in FixRowCol.FixColumnIndices.Split(','))
                    {
                        int i;
                        if (!Int32.TryParse(s, out i))
                            throw new ArgumentException("FixColumnIndices", "含有非整形的字符");
                        if (i > e.Row.Cells.Count)
                            throw new ArgumentOutOfRangeException("FixColumnIndices", "溢出");

                        e.Row.Cells[i].Attributes.Add("style", "position: relative; left: expression(this.offsetParent.scrollLeft);");
                    }
                }

                bool isFixRow = false; // 当前行是否固定
                if (FixRowCol.IsFixHeader && e.Row.RowType == DataControlRowType.Header)
                {
                    isFixRow = true;
                }

                if (!String.IsNullOrEmpty(FixRowCol.FixRowIndices) && e.Row.RowType == DataControlRowType.DataRow)
                {
                    // 行索引
                    foreach (string s in FixRowCol.FixRowIndices.Split(','))
                    {
                        int i;
                        if (!Int32.TryParse(s, out i))
                            throw new ArgumentException("FixRowIndices", "含有非整形的字符");
                        if (i > e.Row.Cells.Count)
                            throw new ArgumentOutOfRangeException("FixRowIndices", "溢出");

                        if (i == e.Row.RowIndex)
                        {
                            isFixRow = true;
                            break;
                        }
                    }
                }

                // 固定该行
                if (isFixRow)
                {
                    // 该行的每一个单元格
                    for (int j = 0; j < e.Row.Cells.Count; j++)
                    {
                        // 该单元格不属于固定列
                        if (String.IsNullOrEmpty(e.Row.Cells[j].Attributes["style"]) || e.Row.Cells[j].Attributes["style"].IndexOf("position: relative;") == -1)
                        {
                            e.Row.Cells[j].Attributes.Add("style", " position: relative; top: expression(this.offsetParent.scrollTop);");
                        }
                        // 该单元格属于固定列
                        else
                        {
                            e.Row.Cells[j].Attributes.Add("style", e.Row.Cells[j].Attributes["style"] + "top: expression(this.offsetParent.scrollTop); z-index: 666;");
                        }
                    }
                }
            }

            base.OnRowDataBound(e);
        }

5、增加两个私有变量
        /**//// <summary>
        /// 如果固定行、列的话 滚动条的x位置
        /// </summary>
        private int _yy_SmartGridView_x;
        /**//// <summary>
        /// 如果固定行、列的话 滚动条的y位置
        /// </summary>
        private int _yy_SmartGridView_y;

6、重写GridView的OnPreRender方法,用于注册两个HiddenField,以及注册设置GridView的滚动条的位置的javascript代码
        /**//// <summary>
        /// OnPreRender
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            if (FixRowCol.EnableScrollState)
            {
                // 滚动条x位置
                Page.ClientScript.RegisterHiddenField("yy_SmartGridView_x", _yy_SmartGridView_x.ToString());
                // 滚动条y位置
                Page.ClientScript.RegisterHiddenField("yy_SmartGridView_y", _yy_SmartGridView_y.ToString());

                // 设置GridView的滚动条的位置
                Page.ClientScript.RegisterStartupScript(
                    this.GetType(),
                    "jsSetScroll", "<script type=/"text/javascript/">document.getElementById('yy_ScrollDiv').scrollLeft=" + _yy_SmartGridView_x + ";document.getElementById('yy_ScrollDiv').scrollTop=" + _yy_SmartGridView_y + ";</script>"
                    );

                // 将控件注册为要求在页回发至服务器时进行回发处理的控件
                if (Page != null) Page.RegisterRequiresPostBack(this);
            }

            base.OnPreRender(e);
        }

7、重写GridView的Render方法,将GridView用一个div包裹起来。
        /**//// <summary>
        /// Render
        /// </summary>
        /// <param name="writer"></param>
        protected override void Render(HtmlTextWriter writer)
        {
            // 给GridView一个容器 <div>
            if (!FixRowCol.TableWidth.IsEmpty || !FixRowCol.TableHeight.IsEmpty)
            {
                if (FixRowCol.TableWidth.IsEmpty) FixRowCol.TableWidth = new Unit(100, UnitType.Percentage);
                if (FixRowCol.TableHeight.IsEmpty) FixRowCol.TableHeight = new Unit(100, UnitType.Percentage);

                writer.Write("<div id='yy_ScrollDiv' style=/"overflow: auto; width: "
                    + FixRowCol.TableWidth.ToString() + "; height: "
                    + FixRowCol.TableHeight.ToString() + "; position: relative;/" ");

                // 如果保持滚动条的状态的话,用隐藏字段记录滚动条的位置
                if (FixRowCol.EnableScrollState)
                {
                    writer.Write("onscroll=/"document.getElementById('yy_SmartGridView_x').value = this.scrollLeft; document.getElementById('yy_SmartGridView_y').value = this.scrollTop;/">");
                }
                else
                {
                    writer.Write(">");
                }
            }

            base.Render(writer);

            // </div> 结束
            if (!FixRowCol.TableWidth.IsEmpty || !FixRowCol.TableHeight.IsEmpty)
            {
                writer.Write("</div>");
            }
        }

8、获取存储了滚条位置信息的HiddenField的值
        void IPostBackDataHandler.RaisePostDataChangedEvent()
        {

        }

        bool IPostBackDataHandler.LoadPostData(string postDataKey, NameValueCollection postCollection)
        {
            // 获取两个保存了 固定行、列后 的GridView滚动条的位置信息
            _yy_SmartGridView_x = String.IsNullOrEmpty(postCollection["yy_SmartGridView_x"]) ? 0 : Convert.ToInt32(postCollection["yy_SmartGridView_x"]);
            _yy_SmartGridView_y = String.IsNullOrEmpty(postCollection["yy_SmartGridView_y"]) ? 0 : Convert.ToInt32(postCollection["yy_SmartGridView_y"]);

            return false;
        }


控件使用
添加这个控件到工具箱里,然后拖拽到webform上,设置其FixRowCol下的7个属性即可。IsFixHeader是固定表头否?;IsFixPager是固定分页行否?;FixRowIndices是需要固定的行的索引(用逗号“,”分隔);FixColumnIndices是需要固定的列的索引(用逗号“,”分隔);TableWidth是表格的宽度;TableHeight是表格的高度;EnableScrollState为是否保持滚动条的状态
ObjData.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.ComponentModel;

/**//// <summary>
/// OjbData 的摘要说明
/// </summary>
public class OjbData
{
    public OjbData()
    {
        //
        // TODO: 在此处添加构造函数逻辑
        //
    }

    [DataObjectMethod(DataObjectMethodType.Select, true)]
    public DataTable Select()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("no", typeof(string));
        dt.Columns.Add("name", typeof(string));

        for (int i = 0; i < 30; i++)
        {
            DataRow dr = dt.NewRow();
            dr[0] = "no" + i.ToString().PadLeft(2, '0');
            dr[1] = "name" + i.ToString().PadLeft(2, '0');

            dt.Rows.Add(dr);
        }

        return dt;
    }
}

Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>SmartGridView测试</title>
</head>
<body>
    <form id="form1" runat="server">
        <yyc:SmartGridView ID="SmartGridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="ObjectDataSource1" Width="1000px">
            <Columns>
                <asp:BoundField DataField="no" HeaderText="序号" SortExpression="no" />
                <asp:BoundField DataField="name" HeaderText="名称" SortExpression="name" />
                <asp:BoundField DataField="no" HeaderText="序号" SortExpression="no" />
                <asp:BoundField DataField="name" HeaderText="名称" SortExpression="name" />
                <asp:BoundField DataField="no" HeaderText="序号" SortExpression="no" />
                <asp:BoundField DataField="name" HeaderText="名称" SortExpression="name" />
                <asp:BoundField DataField="no" HeaderText="序号" SortExpression="no" />
                <asp:BoundField DataField="name" HeaderText="名称" SortExpression="name" />
                <asp:BoundField DataField="no" HeaderText="序号" SortExpression="no" />
                <asp:BoundField DataField="name" HeaderText="名称" SortExpression="name" />
            </Columns>
            <FixRowCol FixColumnIndices="0,1" FixRowIndices="0" IsFixHeader="True" TableHeight="300px"
                TableWidth="300px" EnableScrollState="true" />
        </yyc:SmartGridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="Select"
            TypeName="OjbData"></asp:ObjectDataSource>
    </form>
</body>
</html>

/*测试版的实现 结束*/ 

pytorch-cifar100学习资料汇总 - 基于PyTorch的CIFAR-100图像分类实践 pytorch-cifar100是一个基于PyTorch实现CIFAR-100数据集图像分类的开源项目。该项目实现了多种经典的深度学习网络模型,如ResNet、DenseNet、VGG等,为开发者提供了在CIFAR-100数据集上进行图像分类实验的代码范例。pytorch-cifar100项目为我们提供了在CIFAR-100数据集上进行图像分类实验的完整代码实现。无论你是想要学习PyTorch的使用,还是研究不同网络模型在CIFAR-100上的表现,这个项目都是一个很好的起点。 阅读详情

相关推荐

ANSYS APDL实战:手把手教你搞定电磁-热耦合分析(附完整命令流)

本文通过一个工业感应加热线圈的实战案例,手把手教你使用ANSYS APDL完成电磁-热耦合分析。内容涵盖从几何建模、材料定义、网格划分到加载求解及后处理的完整流程,重点讲解了使用PLANE13单元进行双向耦合场分析的方法与命令流调试技巧,助力工程师快速掌握这一核心仿真能力。

weixin_29284201的博客 439

WinForm DataGridView定位到指定行/单元格

dataGridView.Rows[1].Selected = true;

Scarlett的博客 2821

【论文阅读】AU检测|《Deep Adaptive Attention for Joint Facial Action Unit Detection and Face Alignment》

摘要 本文旨在从大量没有人工标注的视频中学习用于面部动作单元检测的区分表示。受面部动作是面部肌肉运动这一事实的启发,论文将这些运动描述为不同帧中两幅面部图像之间的转换,并将其用作学习表示的自我监控信号。但是,在不受控制的情况下,这种转换是由面部动作和头部运动引起的。为了消除头部运动的影响,我们提出了一个双圈自动编码器(TCAE),它可以解开面部动作相关运动和头部运动相关运动。具体而言,TCAE被训练成分别将源面部的面部动作和头部姿态改变为目标面部的面部动作和头部姿态。我们的实验验证了TCAE解耦运动的能力。

Celine的博客 4559

如何:精准定位到GridView(DataList/DataTable)对象单元格?----控件与容器之三

一、应用场景 当我们使用GridView/DataTable/DataList等对象编程时,经常会涉及到某行某列单元格内容的动态变化。那么精准定位到 这些单元格就显得尤为重要。否则我们将无从下手。如:用标签控件Label显示GridView的第行三第三列内容。为了解决这 个问题,首先我们要认清GridView、DataTable及DataList(Repeater)的行对应的类,因为行对应的类不同,则其作为行属性 的列的表示形式也不一样。具体如下: 1、GridView行对应的类为:GridVie

xiongxinle的博客 646

傅里叶光学(1)

傅里叶光学,可以看作是通信理论中傅里叶变换等一系列数学思想以及系统理论与光学(主要是衍射光学)相结合的产物关于傅里叶光学的应用领域,本节介绍了成像,当然事实上不可能仅限于成像,经典的还如激光散斑的一些应用,干涉计量,还有傅里叶变换光谱学等等。最后总结一下,傅里叶光学我认为可以看做一个工具,对于任意的系统,它能给出一些数学思想与物理原理进行解释和分析,找出系统的扰动和响应的关系,或者说根据扰动和响应,来研究或者设计一个系统。

m0_53607446的博客 1704

我用 Python 监听了自己的键盘,生成击键热力图,看看每天到底在“摸鱼”还是“搬砖”?

数据采集(监听)、持久化(I/O)与可视化展示,必须是三个完全独立的模块,这符合单一职责原则。在多线程读写 Python 字典时,锁住的时间要尽可能短,防止 I/O 线程把高频的监听线程阻塞住。这类涉及底层的代码与“键盘记录木马”只有一线之隔。永远不要把击键记录通过网络上传,所有数据必须localhost消化。人脑对枯燥的 JSON 日志是不敏感的,但对颜色和空间极其敏感。这也是为什么 Prometheus + Grafana 是标配。使用ctypes。

BUG猿的博客 198

Gridview获取选定行的办法

很久没有做asp.net的研究了,最近在做项目的过程中,还是遇到了一些小麻烦,现将一些注意的事项总结如下:结合以前的代码,总结三种可能的情况.  注意这里的三种方法不是互为补充相互替代的,是应用在不同情况下的。一. 页面代码中有如下语句:          OnSelectedIndexChanged="GridView2_SelectedIndexChanged"   (事实上在设计

爱学习的专栏 929

AgentScope Java 2.0 最佳实践:9 个完整示例手把手带你开发 Java‑Agent

本文基于9 个完整示例,深入剖析从基础对话(BasicChatExample)、工具调用(@Tool 注解)、结构化输出(POJO Schema)、ToolGroup 自主管理、MCP 外部工具集成、Hook 生命周期监控、Spring Boot SSE 流式 Web、JsonSession 会话持久化到中断恢复的全链路实战教程。

program哲学 1792

datatable.js 服务端分页+fixColumns列固定

前言   记得还是15年的时候,工作需要,独自写后台管理系统。。记得那时候,最让我头疼的不是后台逻辑,而是数据的列表展示。列很多的时候,页面显示问题;分页样式问题;表格样式问题;数据加载...很多细节的问题,费时,而且总是达不到我想要的效果...也是那个时候,第一次接触了datatable.js插件,只需要简单的修改配置值,就可以改变表格的方方面面,真的是非常好的体验。。。   不过,因为一...

weixin_30387663的博客 626

黑猫带你学eMMC协议第22篇:emmc可靠写详解(Write Reliability)

1 前言 1.1 声明 本文依据eMMC JEDEC5.1、网络资料及个人工作经验整理而成,如有部分错误请留言。 本文部分内容可能源自网络,侵删。 本文结合eMMC JEDEC5.1协议手册查看效果更佳。 1.2 内容提要 1、什么是可靠性写属性(Write Reliability)? 2、可靠写和普通的写有什么区别? 3、设置可靠写的流程及流程框图。 4、可靠写需要遵循哪些规则? 1.3 参考链接 本文主要参考链接:http://www.up48.com/cn/support/8_37.html 2 什么

黑猫奥利奥的博客 3127

SAP-ABAP:SAP的BAPI_GOODSMVT_CREATE 深度解析

BAPI_GOODSMVT_CREATE 深度解析** **功能定位**:SAP 标准接口,支持 **11 种库存移动场景**(收货/发货/转储/生产投料等),是 MM 模块集成核心

baidu_35680696的博客 1832

上接扩展GridView控件(5) - 固定指定行、指定列

4、重写OnRowDataBound以设置每个单元格的样式,从而实现固定表头、指定行或指定列的功能。 /// <summary>///OnRowDataBound/// </summary>/// <param n...

weixin_33759269的博客 239

芒果YOLO11改进172:ARConv自适应旋转卷积,全网首发 | 即插即用:以增强其表征能力,从而准确检测方向物体,ICCV顶会论文idea

ARConv自适应旋转卷积,全网首发 | 即插即用:以增强其表征能力,从而准确检测方向物体,ICCV顶会论文idea

包括YOLOv5、YOLOv7、YOLOv8等模型改进 1538

扩展GridView控件(五)——固定表头、指定行或指定列

扩展GridView控件(五)——固定表头、指定行或指定列介绍平时使用GridView的时候会有固定表头、指定行或指定列的需求,就像Excel冻结行、列那样。其实我们可以用CSS来搞定。扩展一下GridView,通过设置几个属性来达到这样的功能。控件开发1、新建一个继承自GridView的类,另外为了保持滚动条状态,还要继承IPostBackDataHandler接口    /**////

坚定的锡兵 1537

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

扩展GridView控件(索引) - 增加多个常用功能

文章索引扩展GridView控件(1) - 鼠标经过行时改变行的样式扩展GridView控件(2) - 复合排序和排序状态提示扩展GridView控件(3) - 根据按钮的CommandName设置其客户端属性扩展GridView控件(4) - 联动复选框(复选框的全选和取消全选)扩展GridView控件(5) - 固定指定行、指定列扩展GridView控件(6) - 响应行的单击事件和双击事件扩

lp2007的专栏 3467

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

转gridview的扩展,实现固定列和列头固定。

介绍 扩展GridView控件: 固定指定行、指定列,根据RowType固定行,根据RowState固定行 使用方法(设置FixRowColumn复合属性): FixRowType - 需要固定的行的RowType(用逗号“,”分隔) FixRowState - 需要固定的行的RowState(用逗号“,”分隔) FixRows - 需要固定的行的索引(用逗号“,”分隔) Fi...

weixin_30820077的博客 152

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

扩展GridView控件(全)——增加10个常用功能

扩展GridView控件(全)——增加10个常用功能 控件开发 扩展GridView控件(一)——鼠标经过行时改变行的样式 控件使用 1、鼠标经过行时改变行的样式 CssClassMouseOver - 鼠标经过行时行的样式的CSS类名 2、给字段标题加上排序状态 设置其SortTip下的4个属性即可 SortAscImage - 升序提示图片 SortAscText

drr789的专栏 1743

Asp.net 2.0 自定义控件开发[实现GridView多行表头固定表体滚动效果][示例代码下载]

(一). 概述        1. 实现GridView表头固定表体滚动效果        2. 继承GridView的所有功能, 增加扩展功能, 表体滚动功能; 不需要另外加辅助滚动控件, 如.        3. 支持多行表头滚动, 此控件能够自动检测到使用者增加的表头的行数. 准确的实现表头滚动.            有增加GridView多表头实现方案, 请看[多表头自定

飘逸软件技术信息服务网 6327
上一篇: 扩展GridView控件(4) - 联动复选框(复选框的全选和取消全选)
下一篇: 扩展GridView控件(6) - 响应行的单击事件和双击事件
bookseas
博客等级 码龄20年 4粉丝 16原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值