C# winform DataGridView 一列显示星号
private void myDataGrid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
System.Windows.Forms.TextBox t = e.Control as System.Windows.Forms.TextBox;
if (t != null)
{
if (this.myDataGrid.CurrentCell.ColumnIndex == 13)
t.PasswordChar = '*';
else
t.PasswordChar = new char();
}
}
private void myDataGrid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
// 把第13列显示*号,*号的个数和实际数据的长度相同
if (e.ColumnIndex == 13)
{
if (e.Value != null && e.Value.ToString().Length > 1)
{
e.Value = new string('*',e.Value.ToString().Length);
}
}
}
C# winform DataGridView 一列显示星号的更多相关文章
- Winform DataGridView添加列头checkbox
using System; using System.Data; using System.Drawing; using System.Windows.Forms; using Yanwen.Logi ...
- [Winform]DataGridView列自适应宽度
引言 在做winform项目中,数据控件DataGridView的使用多多少少是会用到的,如果不设置它的属性,默认情况下是不会自适应宽度的,你想查看某项的数据,就不得不将标题栏拖来拖去,挺烦的. 方法 ...
- [WinForm]DataGridView列头右键菜单
[WinForm]DataGridView列头右键菜单 前言 继续"不误正业" - - #,记录一下.有时候有这样的需求:DataGridView的列头菜单可以选择具体显示哪些列, ...
- [WinForm] DataGridView 绑定 DT && ComboBox 列绑定 Dict
一 需求介绍 一般像枚举类型的数据,我们在数据库里存储着诸如(1.2.3.4-)或者("001"."002"."003"-)此类,但是界面 ...
- WinForm DataGridView 绑定泛型List(List<T>)/ArrayList不显示的原因和解决
背景:无意间遇到了一个不大不小的问题,希望对一些遇到的人有所帮助! 一.问题 WinForm DataGridView 绑定泛型List (List<T>)/ArrayList不显示,UI ...
- [转]WinForm DataGridView 绑定泛型List(List<T>)/ArrayList不显示的原因和解决
背景:无意间遇到了一个不大不小的问题,希望对一些遇到的人有所帮助! 一.问题 WinForm DataGridView 绑定泛型List (List<T>)/ArrayList不显示,UI ...
- C#实现WinForm DataGridView控件支持叠加数据绑定
我们都知道WinForm DataGridView控件支持数据绑定,使用方法很简单,只需将DataSource属性指定到相应的数据源即可,但需注意数据源必须支持IListSource类型,这里说的是支 ...
- Winform datagridview相关操作
datagridview显示行号的2种方法: 方法一: 网上最常见的做法是用DataGridView的RowPostPaint事件在RowHeaderCell中绘制行号: privatevoiddat ...
- C# winform DataGridView 常见属性
C# winform DataGridView 属性说明① 取得或者修改当前单元格的内容 ② 设定单元格只读 ③ 不显示最下面的新行 ④ 判断新增行 ⑤ 行的用户删除操作的自定义 ⑥ 行.列的隐藏和删 ...
- winform DataGridView的虚模式填充,CellValueNeeded事件的触发条件
虚模式填充常用来处理大量数据,某个字段的显示问题. DataGridView是.net 2.0新增的表格数据编辑和显示控件,简单的数据显示和编辑,只需直接和数据源绑定就可以了. 对于 一些特殊情况,我 ...
随机推荐
- mathcurve.com
https://mathcurve.com/surfaces.gb/surfaces.shtml
- 自定义类型与Qt元对象系统
个人发现一篇关于在Qt中使用元对象系统支持自定义类型的好博文,记录下防止丢失(如有侵权,烦请告知删除).博文原地址:http://qtdebug.com/qtbook-misc-qvariant/ Q ...
- nginx调试和location用法,匹配url
1.nginx调试输出内容到页面 location = /demo { charset utf-8; default_type text/html; return 500 "服务正在升级,请 ...
- js中构造函数中this指向问题
构造函数构造函数中的this指向new创建的新对象function FOO(name) {this.name = name;console.log(this) // Foo {name: " ...
- deployment.yml参考
apiVersion: apps/v1kind: Deploymentmetadata: labels: com.xx.service: xxxxxxxxxxxxx name: xxxxxxxxxxx ...
- [BOM]分解url参数
分解页面 url 传入参数 转载: 来自https://www.jianshu.com/p/6dd040f6800d function init_params() { var url = locati ...
- 简单的WPF客户端应用开发
1.使用vs创建一个新项目,选择wpf应用 2.创建好项目,在视图=>工具箱,选择要使用的部件 3.单击部件可以改变部件的显示信息,即content的内容就是显示的信息,name为部件的名称,在 ...
- Spring的隔离级别,Spring事务传播属性,Spring事务与数据库事务之间的联系
一.Spring五大事务隔离级别 Spring事务隔离级别比数据库事务隔离级别多一个default在进行配置的时候,如果数据库和spring代码中的隔离级别不同,那么以spring的配置为主.1) D ...
- VS(Visual Studio)如何修改注释的快捷键(换成Ctrl+/)
原文:https://blog.csdn.net/qq_51485453/article/details/123214455 1.点击"工具">"选项" ...
- 运行不出来真的QAQ
学C的时候最大的苦恼是编译不通过和运行不正确 学了C++之后就开始有编译过了但运行不出来的情况了TAT