1:UltraGrid风格设置函数

public static void ColorGrid(ref Infragistics.Win.UltraWinGrid.UltraGrid dgd)
{
//标题
dgd.DisplayLayout.CaptionAppearance.TextHAlign=Infragistics.Win.HAlign.Left;
dgd.DisplayLayout.CaptionAppearance.BackColor=Color.LightSteelBlue;
//边框显示
dgd.DisplayLayout.BorderStyle=Infragistics.Win.UlElementBorderStyle.Solid;
//背景色
dgd.DisplayLayout.Appearance.BackColor=Color.White;
//默认颜色设置
dgd.DisplayLayout.Override.HeaderAppearance.BackColor=Color.LightSteelBlue;//列
dgd.DisplayLayout.Override.RowSelectorAppearance.BackColor=Color.LightSteelBlue;
//选中颜色设置
dgd.DisplayLayout.Override.SelectedCellAppearance.BackColor=Color.SteelBlue;//选中单元格
dgd.DisplayLayout.Override.SelectedRowAppearance.BaceColor=Color.SteelBlue;//选中行
//ActiveRowx颜色设置
dgd.DisplayLayout.Override.ActiveRowAppearance.BackColor=Color.SteelBlue;
}
2:UltraGrid删除选中的行
this.ultraGrid1.DeleteSelectedRows(false);
3:委托
this.ultraGrid1.AfterCellUpdate-=new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ultraGrid1_AfterCellUpdate);
this.ultraGrid1.Rows[0].Cells["字段名"].Value="";
this.ultraGrid1.AfterCellUpdate+=new Infragistics.Win.UltraWinGrid.CellEventHandler(this.ultrGrid1_AfterCellUpdate);
4:判断
e.Cell.Column.Key=="字段名";
5:判断某列是否重复
public static bool CheckIfSame(UltraGrid ug, string colname)
   {
   for(int i = 0; i < ug.Rows.Count; i++)
    {
     for(int j = i+1; j < ug.Rows.Count; j++)
     {
       if(ug.Rows[i].Cells[colname].Text == ug.Rows[j].Cells[colname].Text && ug.Rows[i].Cells[colname].Text != "")
      {
       return true;
      }
     }
    }
    return false;
   }
 
6: Enter切换,在form_load事件里写
 this.ultraGrid1.KeyActionMappings.Add(new Infragistics.Win.UltraWinGrid.GridKeyActionMapping(System.Windows.Forms.Keys.Enter,
Infragistics.Win.UltraWinGrid.UltraGridAction.NextCell,Infragistics.Win.UltraWinGrid.UltraGridState.Is Checkbox,Infragistics.Win.UltraWinGrid.UltraGridState.Cell, 0, 0));
 
7: 选中一行
      this.ultraGrid1.Rows[i].Activate();
       this.ultraGrid1.Rows[i].Selected = true;

infragistcs 又的更多相关文章

随机推荐

  1. Could not create the view: An unexpected exception was thrown.问题解决

    Could not create the view: An unexpected exception was thrown.问题解决 今天打开Myeclipse10的时候,发现server窗口出现一堆 ...

  2. CCF真题之图像旋转

    201503-1 问题描述 旋转是图像处理的基本操作,在这个问题中,你需要将一个图像逆时针旋转90度. 计算机中的图像表示可以用一个矩阵来表示,为了旋转一个图像,只需要将对应的矩阵旋转即可. 输入格式 ...

  3. docker进入容器方法

    更简单的,建议大家下载 .bashrc_docker,并将内容放到 .bashrc 中. $ wget -P ~ https://github.com/yeasy/docker_practice/ra ...

  4. AMAB interconnector PL301(二)

    1)Frequency Conversion Components:包含三种component. AXI-AXI async bridge:拥有两种mode:bypass mode 和 async m ...

  5. ThinkPHP讲解(二)控制器

    在这一节,具体讲解控制器,以Jiaowu应用目录为例. 1.如何写控制器,如何写操作方法? 在模块控制器目录Controller下新建一个控制器文件MainController.class.php,写 ...

  6. [php] How to debug PHP in the terminal

    Here I use Netbeans, xdebug to debug the PHP in the terminal of Ubuntu. 1. you have to install the x ...

  7. MySQL函数汇总

    前言 MySQL提供了众多功能强大.方便易用的函数,使用这些函数,可以极大地提高用户对于数据库的管理效率,从而更加灵活地满足不同用户的需求.本文将MySQL的函数分类并汇总,以便以后用到的时候可以随时 ...

  8. 什么是BI【转】

    产品与服务 - 商务智能 目前,商业智能产品及解决方案大致可分为数据仓库产品.数据抽取产品.OLAP产品.展示产品.和集成以上几种产品的针对某个应用的整体解决方案     商业智能是什么? 简而言之, ...

  9. WM_SETFOCUS和WM_KILLFOCUS、WM_GETDLGCODE、CM_ENTER...

    procedure WMSetFocus (var Message: TWMSetFocus); message WM_SETFOCUS; //获得焦点 procedure WMKillFocus ( ...

  10. 鸟哥的linux私房菜学习记录之正则表达式

    正则表达式具有强大的字符串处理能力,常常用来搜索删除和替换字符串,用途很广. sed awk数据处理工具 diff,cmp,patch,pr文档对比工具