DataGridNoActiveCellColumn.cs
Upload User: hjieqiu
Upload Date: 2013-05-11
Package Size: 16494k
Code Size: 1k
Development Platform:

C#

  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. namespace 人力资源管理系统
  5. {
  6. /// <summary>
  7. /// DataGridNoActiveCellColumn 的摘要说明。
  8. /// </summary>
  9. internal class DataGridNoActiveCellColumn : System.Windows.Forms.DataGridTextBoxColumn
  10. {
  11. //重载DataGridTextBoxColumn类的Edit方法,以便使点击DataGrid中任一单元格都选中当前行
  12. protected override void Edit(CurrencyManager source, int rowNum, Rectangle bounds, bool readOnly, string instantText, bool cellIsVisible)
  13. {
  14. int SelectedRow = rowNum;
  15. this.DataGridTableStyle.DataGrid.Select(SelectedRow);
  16. }
  17. }
  18. }