• DataGridView控件常用技巧总结


    FullRowSelect

    this.dataGridView1.SelectionMode=System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;

       string str = "";

                for (int i = 0; i < dataGridView1.Rows.Count; i++)

                {

                    str += "," + dataGridView1.Rows[i].Cells["cityDataGridViewTextBoxColumn"].FormattedValue.ToString().Trim();

                }

                str = str.Substring(1);

                this.textBox2.AutoCompleteCustomSource

    .AddRange(str.Split(','));

                textBox2.AutoCompleteMode = AutoCompleteMode.Suggest;

                textBox2.AutoCompleteSource = AutoCompleteSource.CustomSource;

     

                //首先声明数据源

                //AutoCompleteStringCollection myCompleteSource = new AutoCompleteStringCollection();

                ////对数据源添加数据

                //foreach (DataRow dr in MyTable.Rows)

                //{

                //    myCompleteSource.Add(dr["ArticleNo"].ToString());

                //}

                ////设置TextBox属性

                //txtKeyWord.AutoCompleteMode = AutoCompleteMode.Suggest;

                //txtKeyWord.AutoCompleteSource = AutoCompleteSource.CustomSource;

                ////绑定数据源

                //txtKeyWord.AutoCompleteCustomSource = myCompleteSource;

     

                //foreach (DataGridViewRow dgvR in dgv.Rows)

                //{

                //    ((DataRowView)dgvR.DataBoundItem).Delete();

                //}

  • 相关阅读:
    同一子网建立ssh通道,映射到本地
    机器学习线性模型-自定义各个模块阶段
    MATLAB中图像处理的函数
    基于鱼皮肤的鱼个体识别(1)
    防骗指南-东南亚绑架,诈骗,菠菜
    防骗指南-识别传销
    防骗指南-套路贷以及肉偿
    防骗指南-套路贷如何识别
    Opencv 特征提取与检测-Haar特征
    1. QCamera2基础组件——cam_semaphore
  • 原文地址:https://www.cnblogs.com/cuiwenke/p/1688420.html
Copyright © 2020-2023  润新知