zoukankan      html  css  js  c++  java
  • DataGridView控件显示行号

    private void dgvKBRollUp_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
            {
                if (dgvKBRollUp.Rows.Count != 0)
                {
                    for (int i = 0; i < e.RowCount; i++)
                    {
                        this.dgvKBRollUp.Rows[e.RowIndex + i].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                        this.dgvKBRollUp.Rows[e.RowIndex + i].HeaderCell.Value = (e.RowIndex + i + 1).ToString();
                    }

                    for (int i = e.RowIndex + e.RowCount; i < this.dgvKBRollUp.Rows.Count; i++)
                    {
                        this.dgvKBRollUp.Rows[i].HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleRight;
                        this.dgvKBRollUp.Rows[i].HeaderCell.Value = (i + 1).ToString();
                    }
     
                }

  • 相关阅读:
    设计模式——桥接模式
    设计模式——工厂模式
    挖个坑
    Java 线程应用
    vtep-ctl + add-ls+ bind-ls +br-get-external-id
    ovs vtep 源码Tunnel_Ip
    vtep-ctl del-ls ls0
    vtep-ctl unbind-ls
    virt manager
    ironic 裸金属 failed to mount sysroot
  • 原文地址:https://www.cnblogs.com/zbo/p/1826962.html
Copyright © 2011-2022 走看看