• DotNetBar 使用笔记


    1.删除表格的某一行数据,必须是VirtualMode  = false 的时候才生效,不然就只是灰色

    SuperDBG_Right.PrimaryGrid.SetDeletedRows(SuperDBG_Right.PrimaryGrid.ActiveRow.RowIndex, 1, true, false);

    SuperGrid 删除某一行数据,在VirtualMode = true 模式下无法正常删除,必须调用PurgeDeletedRows 方法; =false 下一切正常

    //VirtualMode = true 模式下无法正常删除,开始只标记某一行颜色    SuperDBG_Main.PrimaryGrid.ActiveRow.CellStyles.Default.TextColor =  Color.Red; 后来问过才知道有这个方法
    SuperDBG_Main.PrimaryGrid.SetDeletedRows(SuperDBG_Main.PrimaryGrid.ActiveRow.Index,1,true,false);
    SuperDBG_Main.PrimaryGrid.PurgeDeletedRows();

    2.DataGridView 数据加载     https://www.codeproject.com/Articles/23937/Paging-Data-with-DataGridView-in-VirtualMode

    Paging Data with DataGridView in VirtualMode  

    public partial class Form1 : Form
    {
        const int PAGE_SIZE = 5000;
    
        NameListCache _cache = null;
    
        public Form1()
        {
            InitializeComponent();
    
            _cache = new NameListCache( PAGE_SIZE );
    
            dataGridView1.CellValueNeeded +=
                new DataGridViewCellValueEventHandler( dataGridView1_CellValueNeeded );
    
            dataGridView1.VirtualMode = true;
    
            dataGridView1.RowCount = (int)_cache.TotalCount;
        }
    
        private void dataGridView1_CellValueNeeded
            ( object sender, DataGridViewCellValueEventArgs e )
        {
            _cache.LoadPage( e.RowIndex );
    
            int rowIndex = e.RowIndex % _cache.PageSize;
    
            e.Value = _cache.CachedData[rowIndex][e.ColumnIndex];
        }
    } 
    View Code

     

  • 相关阅读:
    树上差分
    Java学习笔记(二)事件监听器
    Java学习笔记(三)Java2D组件
    1066. Root of AVL Tree (25)
    有一种蓝,是神往,是心醉,是心伤
    软考论文的六大应对策略V1.0
    iOS 图形编程总结
    【悼鲁迅】诗一首
    【秋游】诗一首
    【游普罗旺斯薰衣草庄园】诗一首
  • 原文地址:https://www.cnblogs.com/maanshancss/p/7884258.html
Copyright © 2020-2023  润新知