devexpress控件使用技巧

Frederick 贡献于2016-11-06

作者 Rossi  创建于2011-05-25 02:12:00   修改者Rossi  修改于2011-05-27 01:44:00字数75465

文档摘要:DevExpressGridControl使用publicForm2()       {           InitializeComponent();           //不显示内置的导航条。           gc1.UseEmbeddedNavigator=false;           //不显示分组的面板           gv1.OptionsView.ShowGroupPanel=false;           gv2.OptionsView.ShowGroupPanel=false;           //自动改变行高适应内容           gv1.OptionsView.RowAutoHeight=true;           gv2.OptionsView.RowAutoHeight=true;           //允许自动合并单元格           gv1.OptionsView.AllowCellMerge=true;           //如果主从表中,没有找到从表内容也要显示(默认是不显示的)           gv1.OptionsDetail.AllowExpandEmptyDetails=true;           //显示自动筛选行(效果跟Excel的自动筛选差不多)           gv2.OptionsView.ShowAutoFilterRow=true;           //使得GridView不能编辑           gv1.OptionsBehavior.Editable=false;           gv2.OptionsBehavior.Editable=false;           //内置编辑器显示的模式           gv1.OptionsBehavior.EditorShowMode=DevExpress.Utils.EditorShowMode.Click;           //主从表显示的功能是否可用           //gv1.OptionsDetail.EnableMasterViewMode=false;           //如果显示了主从表,每点开个加号,就会显示一个Tabs,里面往往显示了两个面板。           //事实上没必要这样干的。一般选择关闭。关闭的对象是主GridView的此项属性。           gv1.OptionsDetail.ShowDetailTabs=false;                   }       privatevoidbtnExit_Click(objectsender,EventArgse)       {           this.Close();       }       privatevoidbtnOk_Click(objectsender,EventArgse)       {           //设置连接字符串           DbHelperSQL.ConnectionString=DbHelperSQL.CreateConnectionString(@"BUDDHAS\SQLEXPRESS","sa","00000","RTDMES");           DataSetds=newDataSet();           //父GridView的数据           stringsql="selectsc_prno,sc_prnafrommespb04h";           DbHelperSQL.QueryD(sql,ds,"main");           //子GridView的数据           sql="selectpa_name,pa_no,sc_prnofrommespb09h";           DbHelperSQL.QueryD(sql,ds,"son");           //这个是显示主从表的关键,一、GridControl通过检查DataSet.Relations的内容来分析数据           //二、关键名必须与设计GridView的层级关系的levelname相同,否则,结果在意料之外。           DataRelationrelation=newDataRelation("aa",                                                     ds.Tables["main"].Columns["sc_prno"],                                
关键词:

DevExpress GridControl使用 public Form2()         {             InitializeComponent();             //不显示内置的导航条。             gc1.UseEmbeddedNavigator = false;             //不显示分组的面板             gv1.OptionsView.ShowGroupPanel = false;             gv2.OptionsView.ShowGroupPanel = false;             //自动改变行高适应内容             gv1.OptionsView.RowAutoHeight = true;             gv2.OptionsView.RowAutoHeight = true;             //允许自动合并单元格             gv1.OptionsView.AllowCellMerge = true;             //如果主从表中,没有找到从表内容也要显示(默认是不显示的)             gv1.OptionsDetail.AllowExpandEmptyDetails = true;             //显示自动筛选行(效果跟Excel的自动筛选差不多)             gv2.OptionsView.ShowAutoFilterRow = true;             //使得GridView不能编辑             gv1.OptionsBehavior.Editable = false;             gv2.OptionsBehavior.Editable = false;             //内置编辑器显示的模式             gv1.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;             //主从表显示的功能是否可用             //gv1.OptionsDetail.EnableMasterViewMode = false;             //如果显示了主从表,每点开个加号,就会显示一个Tabs,里面往往显示了两个面板。             //事实上没必要这样干的。一般选择关闭。关闭的对象是主GridView的此项属性。             gv1.OptionsDetail.ShowDetailTabs = false;                      }         private void btnExit_Click(object sender, EventArgs e)         {             this.Close();         }         private void btnOk_Click(object sender, EventArgs e)         {             //设置连接字符串             DbHelperSQL.ConnectionString = DbHelperSQL.CreateConnectionString(@"BUDDHAS\SQLEXPRESS", "sa", "00000", "RTDMES");             DataSet ds = new DataSet();             //父GridView的数据             string sql = "select sc_prno,sc_prna from mespb04h";             DbHelperSQL.QueryD(sql,ds,"main");             //子GridView的数据             sql = "select pa_name,pa_no,sc_prno from mespb09h";             DbHelperSQL.QueryD(sql,ds,"son");             //这个是显示主从表的关键,一、GridControl通过检查DataSet.Relations的内容来分析数据             //二、关键名必须与设计GridView的层级关系的level name相同,否则,结果在意料之外。             DataRelation relation = new DataRelation("aa",                                                       ds.Tables["main"].Columns["sc_prno"],                                                       ds.Tables["son"].Columns["sc_prno"]);                          ds.Relations.Add(relation);             //这也是一个关键,不能直接设为:ds,必须指明到表。             gc1.DataSource = ds.Tables["main"];         }   上面的代码是显示一个主从表。显示主从表有些技巧。文档中还没有说出来,俺摸索了一个晚上才搞出来。像上面看到的,事实上很简单。   上面DbHelperSQL是我从CodeMatic 2.0中搞出来的,我自己修改了一下。   上面代码的效果图如下:         对于GridView,我有两大疑问:   一、显示主从表,这个解决了。   二、分组显示,这是报表中经常要用到的,GridView的解决方案很简捷,只需将相应列的GroupIndex属性设一下就成了:     在gridcontrol上击右键,选run designer进入设计模式。在columns栏内点retrieve fields将数据源中所有字段导入进来。  点需要分组的字段,在其属性栏的groupindex依次设为0,1..,在不需要分组的字段上保持-1不变。  进入feature browse/summary /group sammary /summary items中增加要分组进行统计的字段。这里要设其fieldname字段名,showingroupcolumnfooter 显示在哪一栏位,sammarytype显示分组后统计的字段是进行sum(求和,求平均,最大值,最小值等)  在grouping /behavior /grneral /可设两个属性 autoexpandallgroups 设为true时将所有分组展开,反之折叠。  showgroupedcolumns是否在网格是显示你分组依据的哪些字段,false为不显示    同样在feature browse/summary /total sammary 这些不是针对分组,而是针对所有行。在summaryitem中对要处理的列进行设置,主要设置需要处理列的column,summarytype. 当然设好后要将optionview的showfooter属性设为true,表格底部会出现一summary行。   补:另有三个属性需要用,我们查询的结果一般是只读的,并且对每一个单元格最好无焦点,故可同时选所有字段,设allowedit为false;allowfocus为false;readonly为true; 为XtraGrid的GridView加行号。示例代码如下:         //设置行指示器的宽度(行指示器就是最左边那列什么都不显示的列)         //默认情况下,如果要在里面显示行号的话,宽度会不足,数字显示不清晰         //所以要改一下宽度         gv1.IndicatorWidth = 20;         private void gv1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)         {             if (e.Info.IsRowIndicator && e.RowHandle >= 0)             {                 e.Info.DisplayText = (e.RowHandle + 1).ToString().Trim();             }         }   效果图如下:      常用代码: //添加分组统计字段 gridView1.GroupSummary.Add(SummaryItemType.Count, "Product Name", gridView1.Columns["Product Name"]); gridView1.GroupSummary.Add(SummaryItemType.Average, "Unit Price", gridView1.Columns["Unit Price"]); //设置分组统计字段的显示格式 ((GridSummaryItem)gridView1.GroupSummary[gridView1.GroupSummary.Count - 1]).DisplayFormat = "AVR={0:c}"; //设置分组字段 gridView1.Columns["Discontinued"].GroupIndex = 0; //打开所有分组 gridView1.ExpandAllGroups(); //为控件画边框 ControlPaint.DrawBorder3D(e.Graphics,                           r,                            (e.Info.State == DevExpress.Utils.Drawing.ObjectState.Pressed ? Border3DStyle.SunkenOuter : Border3DStyle.RaisedInner)); //焦点单元格的列 gridview1.FocusedColumn //焦点单元格所在行的行号 gridview1.FocusedRowHandle //焦点单元格的值 gridview1.FocusedValue //指定单元格显示的字符串值 gridview1.GetRowCellDisplayText(int rowHandler,string feildName) //指定单元格的值 gridview1.GetRowCellValue(int rowHandler,string feildName) //设置焦点单元格所在行指定列的值 gridview1.SetFocusedRowCellValue(GridColumn col,object value) //设置焦点单元格的值 gridview1.SetFocusedValue(object value) //设置指定单元格的值 //有了这个函数,就可以手工创建行了。 gridview1.SetRowCellValue(int rowHandler,string feildName,object value) gridview1.SetRowCellValue(int rowHandler,GridColumn col,object value) //添加新行的方法 gv1.AddNewRow(); foreach (GridColumn col in gv1.Columns) {   //用RowCount-1的办法是不行的   //gv1.SetRowCellValue(gv1.RowCount-1, col, "aaaaa");   gv1.SetRowCellValue(gv1.FocusedRowHandle, col, "aaaaa"); } gv1.UpdateCurrentRow(); //根据绑定的数据源自动产生列 gv1.PopulateColumns(); //为列添加下拉列表(加其他类型如日期、UpDown同理) RepositoryItemLookUpEdit ri = new RepositoryItemLookUpEdit(); //ri.PopupWidth = 200; ri.DisplayMember = "sc_prna"; ri.ValueMember = "sc_prno"; DataTable dt1 = DbHelperSQL.QueryT("select sc_prno,sc_prna from mespb04h"); ri.DataSource = dt1; gv1.Columns["sc_prno"].ColumnEdit = ri; 零零散散的先总结一下吧 1.TextEditor(barEditItem)取文本 string editValue = barEditItem1.EditValue.ToString(); //错误,返回null   string editValue = ((DevExpress.XtraEditors.TextEdit)barEditItem).EditValue.ToString(); //正确,返回文本框内容 2.ComboBoxEdit(barEditItem)添加Item string item = "comboboxItem1"; ((DevExpress.XtraEditors.Repository.RepositoryItemComboBox)this.barEditItem.Edit).Items.Add(item); 3.ComboBoxEdit(barEditItem)取文本 string itemValue = this.barEditItem.EditValue.ToString(); 4.Ribbon控件 //添加Page DevExpress.XtraBars.Ribbon.RibbonPage ribbonPage = new RibbonPage(); ribbonControl.Pages.Add(ribbonPage); //添加Group DevExpress.XtraBars.Ribbon.RibbonPageGroup ribbonPageGroup = new RibbonPageGroup(); ribbonPage.Groups.Add(ribbonPageGroup); //添加Button DevExpress.XtraBars.BarButtonItem barButtonItem = new BarButtonItem(); ribbonPageGroup.ItemLinks.Add(barButtonItem); //添加barSubItem DevExpress.XtraBars.BarSubItem barSubItem = new BarSubItem(); ribbonPageGroup.ItemLinks.Add(barSubItem); //barSubItem下添加Button barSubItem.AddItem(barButtonItem);     //奇怪的删除Page问题 while (this.ribbonControl.Pages.Count > 0) { ribbonControl.Pages.Remove(ribbonControl.Pages[0]); //调试正常,运行报异常 } while (this.ribbonControl.Pages.Count > 0) { ribbonControl.SelectedPage = ribbonControl.Pages[0]; ribbonControl.Pages.Remove(ribbonControl.SelectedPage); //运行正常 } //禁止F10键Tips ribbonControl.Manager.UseF10KeyForMenu = false; //DX按钮 ApplicationIcon属性改变图标 右键 Add ApplicationMenu 添加evExpress.XtraBars.Ribbon.ApplicationMenu 5.HitInfo //在Tab页上点击右键的事件响应 void xtraTabbedMdiManager_Event(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && ActiveMdiChild != null) { DevExpress.XtraTab.ViewInfo.BaseTabHitInfo hInfo = xtraTabbedMdiManager.CalcHitInfo(e.Location); //右键点击位置:在Page上且不在关闭按钮内 if (hInfo.IsValid && hInfo.Page != null && !hInfo.InPageCloseButton) { this.popupMenu.ShowPopup(Control.MousePosition);//在鼠标位置弹出,而不是e.Location } } } //在ribbon上点击右键的事件响应 private void ribbonControl1_ShowCustomizationMenu(object sender, RibbonCustomizationMenuEventArgs e) { //禁掉原系统右键菜单 e.ShowCustomizationMenu = false; //右键位置:在barButtonItem上 if (e.HitInfo != null && e.HitInfo.InItem && e.HitInfo.Item.Item is BarButtonItem) { this.popupMenu.ShowPopup(Control.MousePosition); } //右键位置:在barSubItem中的barButtonItem上 else if (e.Link != null && e.Link.Item != null && e.Link.Item is BarButtonItem) { this.popupMenu.ShowPopup(Control.MousePosition); } } 6.皮肤 //添加皮肤程序集后注册皮肤 DevExpress.UserSkins.OfficeSkins.Register(); DevExpress.UserSkins.BonusSkins.Register(); //设置皮肤 DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Liquid Sky"); //若皮肤名称错误则按系统默认设置(第一个皮肤) //GalleryFilterMenuPopup事件设置弹出筛选菜单的“All Groups”为中文 private void rgbiSkins_GalleryFilterMenuPopup(object sender, GalleryFilterMenuEventArgs e) { e.FilterMenu.ItemLinks[n].Caption = "所有皮肤"; //n=分组数+1 } //GalleryInitDropDownGallery事件设置弹出皮肤列表的表头“ALL Groups”为中文 private void rgbiSkins_GalleryInitDropDownGallery(object sender, InplaceGalleryEventArgs e) { e.PopupGallery.FilterCaption = "所有皮肤"; } 7.dockManager 将视图的状态信息保存到xml文件 dockManager1.SaveLayoutToXml("..\\UserConfig\\ViewInfo.xml"); 导出xml中保存的状态信息 dockManager1.RestoreLayoutFromXml("..\\UserConfig\\ViewInfo.xml"); 8.barManager 设置bar的字体与系统字体 barAndDockingController1.AppearancesBar.ItemsFont = new Font(this.Font.FontFamily, currentFontSize); 9.设置系统字体 DevExpress.Utils.AppearanceObject.DefaultFont = new Font(this.Font.FontFamily, currentFontSize); 10.treeView 为tree节点加右键菜单并选中该节点 private void treeList1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { DevExpress.XtraTreeList.TreeListHitInfo hi = treeList1.CalcHitInfo(e.Location); if (hi.Node != null && hi.Node.ImageIndex == 5) //叶子节点的ImageIndex == 5 { TreeListNode node = treeList1.FindNodeByID(hi.Node.Id); treeList1.FocusedNode = node;   this.popupMenu1.ShowPopup(MousePosition); } } } DevExpress使用心得(转) 2011-01-13 14:15 Developer Express(以下简称dev) 这个第三方控件是VS2005自带的datagridview控件的重写版本.对于一些grid外观,模板列的设置有非常简单的方法.而且控制起来基本和datagridview一样.所以还是比较方便的.把dev控件拖到窗体以后,会发现多了两个控件gridcontrol1,gridview1,下面针对这期间使用dev的一些总结写在下面(主要是连接数据库,绑定字段和模板列的设置): 1. 设置数据源: string sql = "select fid,fname from dual"; DataTable dt = DALUse.Query(sql).Tables[0]; gridControl1.DataSource = dt; *:Daluse是项目数据库连接基类,不用特别理会 2.绑定字段: 这部分工作主要是在Designer中进行的,dev的Designer设计器提供了非常方便的设置方式.我么可以省去敲代码,直接在设计器中就可以完成了.在左边选Columns,添加完列以后,在列的FieleName属性添加你要绑定列的字段名(ps:比如我的连接SQL语句是:select fid,fname from dual.我想要把fid绑定到列1.那就在列1的FieldName属性写FID就可以了   ),这里有非常重要的一点,对于Oracle数据库,所有的在设计器里写的程序中的字段名必须大写,否则可能绑定不上字段,sqlserver没有这个限制.通过代码其实也可以实现,具体代码如下: gridView1.Columns[0].FieldName = "FID";   *:gridcontrol只用在设置数据源,以后的操作大多都有gridview这个控件了.他们是一体的,可以在页面的设计代码中找到将他们关联的一句话,这是系统自动写的:gridcontrol1.mainview=this.gridview1.   2. 模板列的设置: 模板列可以很轻松的让用户实现在表格中进行查找编辑. 同样,这部分工作在dev的Designer中进行.在左边选In-Place Editor Repository,上面的ADD提供了比较丰富的模板列类型,从中选取一个就可以了.模板列建好以后就要和我们当前有的数据列进行绑定了.返回到Columns中,假如列1是我们想设定的,在他的属性中找到ColumnEdit.选择我们加进去的模板列就可以了.对于模板列我们最常用的还是LookUpEdit. 这里简单说下他的设置和用法:   LookUpEdit是弹出的一个小的grid,从它里面我们可以实现自动筛选里面的信息. 首先从In-Place Editor Repository中添加LookUpEdit.取名为Re1.然后.在他的Columns属性中添加3列.Caption依次为:编号,姓名,性别.FieldName依次为:FID,FNAME,FSEX.然后将Re1的NullText设置成空. AutoSearchColumnIndex属性设置为2.ImmediatePopup属性设置为True. SearchMode设置为OnlyInPopup. 然后将这个模板列附加到我们上面提到的列1(也就是将列1的ColumnEdit属性设成Re1) 最后我们还要在代码里面给Re1绑定数据源和显示项.   Re1.DataSource = DALUse.Query("select fid,fname,fsex from dual").Tables[0]; Re1.DisplayMember = "FSEX"; Re1.ValueMember = "FNAME"; *:对于Oracle数据库字段一定要用大写,切记!!   至此,我们的LookUpEdit模板列就设置完成了,它现在已经实现了通过性别列检索,然后将姓名列附到我们的列1上. 对于LookUpEdit可以实现过滤主要是AutoSearchColumnIndex和SearchMode属性.可以参见帮助知道它们的用法: ms-help://DevExpress.NETv7.2/DevExpress.XtraEditors/DevExpressXtraEditorsControlsSearchModeEnumtopic.htm     Ps: //去掉上面的筛选条 gridView1.OptionsView.ShowGroupPanel = false;   //设某一列只读或者不可编辑 gridView1.Columns[0].OptionsColumn.AllowEdit = false; gridView1.Columns[0].OptionsColumn.ReadOnly = false;   //设某一列文字和标题局中显示                  gridView1.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;                    gridView1.Columns[0].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;   //去掉某一列上面的自动筛选功能(Filter)                   gridView1.Columns[0].OptionsFilter.AllowAutoFilter = false; gridView1.Columns[0].OptionsFilter.AllowFilter = false;                gridView1.Columns[0].OptionsFilter.ImmediateUpdateAutoFilter = false;   //设置冻结列(左冻结) gridView1.Columns[0].Fixed= DevExpress.XtraGrid.Columns.FixedStyle.Left;   //得到单元格数据(0行0列) string ss=gridView1.GetRowCellDisplayText(0, gridView1.Columns[0]); string ss = gridView1.GetRowCellValue(0, gridView1.Columns[0]);   //设置单元格数据(将0行0列的单元格赋值123) gridView1.SetRowCellValue(0, gridView1.Columns[0], "123");   //手动添加dev的列 DevExpress.XtraGrid.Columns.GridColumn Col1=new DevExpress.XtraGrid.Columns.GridColumn (); Col1.FieldName="FID"; Col1.Visible=true; Col1.VisibleIndex=gridView1.Columns.Count; gridView1.Columns.Add(Col1); //设置自动增加的行号,需要先添加给gridview添加事件CustomDrawRowIndicator         private void gridview_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)         {             if (e.Info.IsRowIndicator && e.RowHandle >= 0)                 e.Info.DisplayText = (e.RowHandle + 1).ToString();         }     //添加datatable数据行,数据列                     DataTable dt = new DataTable();                     dt.Columns.Add("Col1");                     DataRow dr = dt.NewRow();                     dr[0] = "123";                     dt.Rows.Add(dr);   *以上这些都可以在Designer中进行设置,而不用去敲代码                                               对于第三方控件的整体修改和保存,具体说明如下: 1.     删除: (修改了dgvdel里的datagridviewdel方法) public static void datagridviewdel_Dev(DevExpress.XtraGrid.Views.Grid.GridView Mydgv)         {             if (MessageBox.Show("你确定要删除选中的记录吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0, false) == DialogResult.Yes)             {                 int iSelectRowCount = Mydgv.SelectedRowsCount;                                if (iSelectRowCount > 0)                 {                     Mydgv.DeleteSelectedRows();                                }                }         }   2. 新增: (对于新增,其本身的AddNewRow方法就可以做到)   private void btn_add_Click(object sender, EventArgs e)         { gridView1.AddNewRow();    } 具体如果对于新加行还有什么特别的设置,可以在它gridView1_InitNewRow事件中填写: private void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)         {             ColumnView View = sender as ColumnView;             View.SetRowCellValue(e.RowHandle, View.Columns[0], gridView1.GetRowCellValue(gridView1.GetRowHandle(gridView1.RowCount - 2), gridView1.Columns[0])); //复制最后一行的数据到新行             View.SetRowCellValue(e.RowHandle, View.Columns[1], gridView1.GetRowCellValue(gridView1.GetRowHandle(gridView1.RowCount - 2), gridView1.Columns[1])); //复制最后一行的数据到新行         }   3.     保存 (第三方控件提供的RefreshData和RefreshDataSource方法对于保存数据都不好使,最后还是使用了Dgvsave的datagridviewsave方法,用这个方法就可以)       注:代码中出现多gridView1全为第三方控件的gridView.   示例: 去掉上面的”Drag a column header here to group by that column” 我们拖动一个gridcontrol控件后,在出现上会出现一下效果: 他默认的好多地方都是用英文表示出来的,所以我们得用一些相关的属性设置来达到我们实际想要达到的效果.首先就是要去掉上面的一个英文条”Drag a column header here to group by that column”.我们可以通过手工设置和代码编写来实现,以后针对第三方控件的属性都可以用这两种方法来实现.手工设置:点击左下角的”Run Designer”按钮. 这样我们就进入了Dev的设计器(所有的对于控件的控制都可以在这里设置).然后点击左边的Main选项卡中的Views项.有边栏目里会出现N多属性,我们找到OptionViews,展开它,然后将里面的ShowGroupPanel属性设成false就OK了.代码编写: 我们可以直接在构造函数或者页面的打开事件中写入代码: gridView1.OptionsView.ShowGroupPanel = false; 两种方法可以达到同样的效果. 设置外观 接下来我们来设置它的外观.Dev给我们提供了很多外观的模板,这样使得我们不用在通过复杂的代码来设置他的外观,我们直接用手工设置就可以完成了!点击Dev设计器中左边的Appearance选项卡的Style Schemes项: 通过在里面设置外观,然后点击右小角的Apply按钮就可以很轻松的设置各种各样的外观了. 去掉控件默认的Filter功能出现英文的情况 我们按照上面所讲的方法给Dev添加列后,在点击列头的小按钮的时候会出现这样的效果(出现了我们不想看到的英文): 这个对于我们来说是比较讨厌的.我们可以在Dev的设计器中消灭它.点击设计器中左边的Main选项卡的Columns项.选择你想设置的列,然后点击右上角他们的选项卡: 选择Filter options选项卡,然后将里面的AllowAutoFilter,AllowFilter,ImmediateUpdateAutoFilter属性分别设成false就可以了.这样这列的AutoFilter功能就去掉了(仅限于这列)!如果你够细心的话,你会发现上面的选项卡Column options里面的属性也都是特别使用的: 这里面的属性不用说,我想你也知道怎么用了(他也是只针对一列设置的). 关闭右键点击列头会出现英文的情况: 在Dev的设计器中选择左边Main选项卡中的Views项.找到OptionsMenu,然后展开,将里面的EnableColumnMenu设成false就可以了. DevExpress之GridControl控件小知识 2011-01-13 14:12 一.当代码中的DataTable中有建数据关系时,DevExpress 的 GridControl 会自动增加一个子视图 .列名也就是子表的字段名 ,按下面方法自定义子视图 DevExpress控件,当Table建立关系后,子表显示的Grid设置,在不设置的情况下默认显示一个Grid,但列头的名字为数据源的列名需要更改列头的描述必须自定义一个Grid,步骤: 1.[Clike here to create a new leve]点击此处创建一个Leve 2.单建刚建出的Leve右边的[Click here to change view]选择一个View类型 3.为GridControl增加LeveDefault,例如:     MyGridControl.LevelDefaults.Add(RelationName,gridview);     RelationName:DataSet中关系名     gridview:第二步建立的GridView的名称 二.DevExpress子视图的访问--当需要访问父视图中的行对应的子视图中的数据 DevExpress.XtraGrid.Views.Grid.GridView bv =(DevExpress.XtraGrid.Views.Grid.GridView) gvMain.GetDetailView(MyGridControl.FocusedRowHandle,0) ; //0是关系索引 for(int i=0 ;i= 0)             {                 e.Info.DisplayText = (e.RowHandle + 1).ToString().Trim();             }         }   效果图如下:        常用代码: //添加分组统计字段 gridView1.GroupSummary.Add(SummaryItemType.Count, "Product Name", gridView1.Columns["Product Name"]); gridView1.GroupSummary.Add(SummaryItemType.Average, "Unit Price", gridView1.Columns["Unit Price"]); //设置分组统计字段的显示格式 ((GridSummaryItem)gridView1.GroupSummary[gridView1.GroupSummary.Count - 1]).DisplayFormat = "AVR={0:c}"; //设置分组字段 gridView1.Columns["Discontinued"].GroupIndex = 0; //打开所有分组 gridView1.ExpandAllGroups(); //为控件画边框 ControlPaint.DrawBorder3D(e.Graphics,                           r,                            (e.Info.State == DevExpress.Utils.Drawing.ObjectState.Pressed ? Border3DStyle.SunkenOuter : Border3DStyle.RaisedInner)); //焦点单元格的列 gridview1.FocusedColumn //焦点单元格所在行的行号 gridview1.FocusedRowHandle //焦点单元格的值 gridview1.FocusedValue //指定单元格显示的字符串值 gridview1.GetRowCellDisplayText(int rowHandler,string feildName) //指定单元格的值 gridview1.GetRowCellValue(int rowHandler,string feildName) //设置焦点单元格所在行指定列的值 gridview1.SetFocusedRowCellValue(GridColumn col,object value) //设置焦点单元格的值 gridview1.SetFocusedValue(object value) //设置指定单元格的值 //有了这个函数,就可以手工创建行了。 gridview1.SetRowCellValue(int rowHandler,string feildName,object value) gridview1.SetRowCellValue(int rowHandler,GridColumn col,object value)   //添加新行的方法 gv1.AddNewRow(); foreach (GridColumn col in gv1.Columns) {   //用RowCount-1的办法是不行的   //gv1.SetRowCellValue(gv1.RowCount-1, col, "aaaaa");   gv1.SetRowCellValue(gv1.FocusedRowHandle, col, "aaaaa"); } gv1.UpdateCurrentRow();    //根据绑定的数据源自动产生列 gv1.PopulateColumns();    //为列添加下拉列表(加其他类型如日期、UpDown同理) RepositoryItemLookUpEdit ri = new RepositoryItemLookUpEdit(); //ri.PopupWidth = 200; ri.DisplayMember = "sc_prna"; ri.ValueMember = "sc_prno"; DataTable dt1 = DbHelperSQL.QueryT("select sc_prno,sc_prna from mespb04h"); ri.DataSource = dt1; gv1.Columns["sc_prno"].ColumnEdit = ri; DevExpress ,XtraGrid,GridControl,Gridview 使用点滴 2011-01-13 15:48 1.在单元里显示日历控件、下拉框等    Imports DevExpress.XtraEditors.Repository    Dim irdata As New RepositoryItemCalcEdit    GridView1.Columns(1).ColumnEdit = irdata    2.格式化数字 ###,###.00            GridView1.Columns(4).DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric  '此行必须要,不然下面的没有作用            GridView1.Columns(4).DisplayFormat.FormatString = "¥{0:N2}"   3. 获得某单元格的值    GridView1.GetRowCellValue(GridView1.FocusedRowHandle, GridView1.FocusedColumn)    4.用代码显示分组                'GridView1.OptionsView.ShowGroupPanel = False'隐藏分组            GridView1.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, "amount", GridView1.Columns("amount"), "小计:{0:N2}")    '可以显示小计            GridView1.Columns("summary_id").GroupIndex = 2            GridView1.ExpandAllGroups()  ' 初始就分组    '当然不能少了一句:    GridView1.OptionsView.ShowFooter = True          5.代码设置过滤条件            GridView1.Columns("kmbm").FilterInfo = New ColumnFilterInfo(ColumnFilterType.Custom, Nothing, "[kmbm] like '%1001%' and [kmbm] like '%6%'")    '此处列名为kmbm , 区分大小写.       6.弹出菜单     PopupMenu1.ShowPopup(Control.MousePosition)  DevExpress 部分操作代码 2011-01-17 13:25 ///GridControl的删除操作 privatevoid rILinkEditInfoDel_Click(object sender, EventArgs e) {     if (XtraMessageBox.Show("请确定是否删除当前记录?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)     {         DataRow row = gvInfos.GetDataRow(gvInfos.FocusedRowHandle);          delByCode(row["Code"].ToString());         XtraMessageBox.Show("操作成功!");     } } ///绑定非数据表中列 Hashtable ht = new Hashtable(); privatevoid gridView6_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e) {     GridView View = sender as GridView;     if (e.RowHandle >= 0)     {          object needAlert = View.GetRowCellValue(e.RowHandle, View.Columns["needAlert"]);         if (needAlert != null && needAlert != DBNull.Value && needAlert.ToString().Trim() != "0" && View.GetRowCellValue(e.RowHandle, View.Columns["Value"]) != DBNull.Value)         {             decimal AverValue = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["Value"]));             object MinValue = View.GetRowCellValue(e.RowHandle, View.Columns["MinValue"]);             object MaxVlaue = View.GetRowCellValue(e.RowHandle, View.Columns["MaxValue"]);             if (MinValue != DBNull.Value && MinValue != null && MaxVlaue.ToString() != "" && MaxVlaue != DBNull.Value && MaxVlaue != null && MaxVlaue.ToString() != "")             {                 decimal gridColumn2 = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["MinValue"]));                 decimal gridColumn1 = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["MaxValue"]));                 if (gridColumn2 > AverValue || AverValue > gridColumn1)                 {                     if (!ht.ContainsKey("pic"))                         ht.Add("pic", GetImage(1));                     e.Value = ht["pic"];                 }             }         }     } } /// /// 由资源文件获取图片 /// /// /// byte[] GetImage(int key) {     Image img = DevExpress.Utils.Controls.ImageHelper.CreateImageFromResources(string.Format("RiverSys.Resources.{0}.gif", key.ToString()),typeof(RiverInfos).Assembly);     return DevExpress.XtraEditors.Controls.ByteImageConverter.ToByteArray(img, ImageFormat.Gif); } /// /// 动态根据条件设置行样式 /// /// /// privatevoid gridView6_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) {     GridView View = sender as GridView;     if (e.RowHandle >= 0)     {         object needAlert = View.GetRowCellValue(e.RowHandle, View.Columns["needAlert"]);         if (needAlert != null && needAlert != DBNull.Value && needAlert.ToString().Trim() != "0" && View.GetRowCellValue(e.RowHandle, View.Columns["Value"]) != DBNull.Value)         {             decimal AverValue = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["Value"]));             object MinValue = View.GetRowCellValue(e.RowHandle, View.Columns["MinValue"]);             object MaxVlaue = View.GetRowCellValue(e.RowHandle, View.Columns["MaxValue"]);             if (MinValue != DBNull.Value && MinValue != null && MaxVlaue.ToString() != "" && MaxVlaue != DBNull.Value && MaxVlaue != null && MaxVlaue.ToString() != "")             {                 decimal gridColumn2 = Convert.ToDecimal(MinValue);                 decimal gridColumn1 = Convert.ToDecimal(MaxVlaue);                 if (gridColumn2 > AverValue || AverValue > gridColumn1)                 {                     e.Appearance.ForeColor = Color.Red;                     e.Appearance.BackColor = Color.LightGray;                 }             }         }     } } ///GridControl 中颜色选择控件 privatevoid gvMapColor_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e) {     GridView view = sender as GridView;     DataView dv = view.DataSource as DataView;     if (e.IsGetData)     {         string strVal = dv[e.ListSourceRowIndex]["Color"].ToString();         if (strVal != "")         {             //e.Value = DevExpress.Utils.StyleLayout.ColorFromString(strVal);             e.Value = Common.HexToColor(strVal);         }     }     else     {         //Color colorVal = DevExpress.Utils.StyleLayout.ColorFromString(e.Value.ToString());         Color colorVal = (Color)e.Value;         dv[e.ListSourceRowIndex]["Color"] = Common.RGB_HEX(colorVal.ToArgb());     } } ///关于 GridControl 验证示例 /**//// /// 初始化GridView,绑定数据 /// /// privatevoid GridViewBindData(string parentId) { this.gridView1.Columns.Clear(); this.FDs= areaSetupActionHelper.getDsRegionByParentId(parentId); this.gridCArea.DataSource =this.FDs.Tables[0].DefaultView;    this.gridView1.Columns["id"].VisibleIndex = -1;    this.gridView1.Columns["childCounts"].VisibleIndex = -1;    this.gridView1.Columns["reg_id"].Caption = "区划编号";    this.gridView1.Columns["reg_name"].Caption = "区划名称";    this.gridView1.Columns["parent_id"].Caption = "父区划编号";    this.gridView1.Columns["reg_desc"].Caption = "区划描述";    this.gridView1.Columns["parent_id"].ImageIndex =1;    this.gridView1.Columns["reg_desc"].ImageIndex = 0;    RepositoryItemTextEdit textEditReg_Id = new RepositoryItemTextEdit();    textEditReg_Id.Mask.EditMask =parentId+"\\d{2,3}";    textEditReg_Id.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Regular;    this.gridView1.Columns["reg_id"].ColumnEdit = textEditReg_Id;    this.gridView1.Columns["reg_desc"].ColumnEdit = new RepositoryItemMemoExEdit();    TreeListNode node = this.treelArea.FocusedNode.ParentNode;    string fid = node==null?"0":node.GetValue("RegID").ToString().Trim();    DataSet ds = areaSetupActionHelper.getDsRegionByParentId(fid);    RepositoryItemLookUpEdit lookUEParent_Id = new RepositoryItemLookUpEdit();    lookUEParent_Id.Columns.Add(new LookUpColumnInfo("reg_id", 40, "区划编号"));    lookUEParent_Id.Columns.Add(new LookUpColumnInfo("reg_name", 40, "区划名称"));    lookUEParent_Id.DataSource = ds.Tables[0].DefaultView;    lookUEParent_Id.ValueMember = "reg_id";    lookUEParent_Id.DisplayMember = "reg_id";    this.gridView1.Columns["parent_id"].ColumnEdit = lookUEParent_Id; } /**//// /// gridView单元格验证的相关处理程序 /// /// /// privatevoid gridView1_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) { if (e.Valid == false&&this.gridView1.FocusedColumn.FieldName == "reg_id") {      e.ErrorText = "区划编号不合法!\n应为父区划编号加2~3位数据组成!";       }    if (this.gridView1.FocusedColumn.FieldName == "reg_name")    {         Regex reg=new Regex(@"[\u4e00-\u9fa5]{1,20}");     Match m=reg.Match(e.Value.ToString().Trim());     if (m.Length != e.Value.ToString().Trim().Length)     {      e.Valid = false;      e.ErrorText = "区划名称应为汉字\n长度为1至20";     }    } } privatevoid gridView1_InvalidValueException(object sender, InvalidValueExceptionEventArgs e) {    if (MyDialog.Alert(" 您所填写的内容不符合规则\n 要放弃您刚才对此项所做的更改吗?", "您所编辑的内容不符合规则", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)    {     e.ExceptionMode = ExceptionMode.Ignore;    } } /**//// /// gridView行验证的相关处理程序 /// privatevoid gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { string regid = this.gridView1.GetRowCellValue(e.RowHandle, "reg_id").ToString().Trim(); string regName = this.gridView1.GetRowCellValue(e.RowHandle, "reg_name").ToString().Trim(); if ( regid.Length < 1) {     e.Valid = false;     this.gridView1.SetColumnError(this.gridView1.Columns["reg_id"], "请填写区划编号!", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Default);      // e.ErrorText = "区划名称不能为空!";    }     if (regName.Length < 1)    {     e.Valid = false;     this.gridView1.SetColumnError(this.gridView1.Columns["reg_name"], "区划名称不能为空!", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Default);    } } privatevoid gridView1_InvalidRowException(object sender, DevExpress.XtraGrid.Views.Base.InvalidRowExceptionEventArgs e) {    if (e.RowHandle >= 0)    {     if (this.gridView1.GetRowCellValue(e.RowHandle, this.gridView1.Columns["reg_id"]).ToString().Trim() == "" ||this.gridView1.GetRowCellValue(e.RowHandle, this.gridView1.Columns["reg_name"]).ToString().Trim() == "")     {      if (MyDialog.Alert(" 您所填写的内容不符合规则\n 要放弃您刚才对此项所做的更改吗?", "您所编辑的内容不符合规则", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)      {       e.ExceptionMode = ExceptionMode.Ignore;      }      else      {       e.ExceptionMode = ExceptionMode.NoAction;      }     }    }    else    {     e.ExceptionMode = ExceptionMode.Ignore;    } } DevExpress 经典常用功能代码收集 2010-11-26 08:31 ‍DevExpress 经典常用功能代码收集 May 18, 2010 | tags DevExpress  WinformGridControl  DEV常用功能代码   | views Comments 0         随着DevExpress 控件包越来越多的被中国用户使用,由于是英文版本,看英文版使用说明非常困难,慧都控件网在DevExpress 控件包使用方面有多年的研究,慧都控件网会不断的把DevExpress 使用经验分享给大家。         下面是我们平时收集最常用的DevExpress Winform 4个代码片段,比较常用,希望对广大DEV用户有帮助。 一 、GridControl的删除操作 private void rILinkEditInfoDel_Click(object sender, EventArgs e) {      if (XtraMessageBox.Show("请确定是否删除当前记录?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)      {          DataRow row = gvInfos.GetDataRow(gvInfos.FocusedRowHandle);           delByCode(row["Code"].ToString());          XtraMessageBox.Show("操作成功!");      } } 二、绑定非数据表中列 Hashtable ht = new Hashtable(); private void gridView6_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e) {      GridView View = sender as GridView;      if (e.RowHandle >= 0)      {          object needAlert = View.GetRowCellValue(e.RowHandle, View.Columns["needAlert"]);          if (needAlert != null & needAlert != DBNull.Value && needAlert.ToString().Trim() != "0" & View.GetRowCellValue(e.RowHandle, View.Columns["Value"]) != DBNull.Value)          {              decimal AverValue = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["Value"]));              object MinValue = View.GetRowCellValue(e.RowHandle, View.Columns["MinValue"]);              object MaxVlaue = View.GetRowCellValue(e.RowHandle, View.Columns["MaxValue"]);              if (MinValue != DBNull.Value & MinValue != null & MaxVlaue.ToString() != "" & MaxVlaue != DBNull.Value && MaxVlaue != null & MaxVlaue.ToString() != "")              {                  decimal gridColumn2 = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["MinValue"]));                  decimal gridColumn1 = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["MaxValue"]));                  if (gridColumn2 > AverValue || AverValue > gridColumn1)                  {                      if (!ht.ContainsKey("pic"))                          ht.Add("pic", GetImage(1));                      e.Value = ht["pic"];                  }              }          }      } } /// /// 由资源文件获取图片 /// /// /// byte[] GetImage(int key) {      Image img = DevExpress.Utils.Controls.ImageHelper.CreateImageFromResources(string.Format("RiverSys.Resources.{0}.gif", key.ToString()), typeof(RiverInfos).Assembly);      return DevExpress.XtraEditors.Controls.ByteImageConverter.ToByteArray(img, ImageFormat.Gif); } /// /// 动态根据条件设置行样式 /// /// /// private void gridView6_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) {      GridView View = sender as GridView;      if (e.RowHandle >= 0)      {          object needAlert = View.GetRowCellValue(e.RowHandle, View.Columns["needAlert"]);          if (needAlert != null & needAlert != DBNull.Value && needAlert.ToString().Trim() != "0" & View.GetRowCellValue(e.RowHandle, View.Columns["Value"]) != DBNull.Value)          {              decimal AverValue = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["Value"]));              object MinValue = View.GetRowCellValue(e.RowHandle, View.Columns["MinValue"]);              object MaxVlaue = View.GetRowCellValue(e.RowHandle, View.Columns["MaxValue"]);              if (MinValue != DBNull.Value & MinValue != null & MaxVlaue.ToString() != "" & MaxVlaue != DBNull.Value && MaxVlaue != null & MaxVlaue.ToString() != "")              {                  decimal gridColumn2 = Convert.ToDecimal(MinValue);                  decimal gridColumn1 = Convert.ToDecimal(MaxVlaue);                  if (gridColumn2 > AverValue || AverValue > gridColumn1)                  {                      e.Appearance.ForeColor = Color.Red;                      e.Appearance.BackColor = Color.LightGray;                  }              }          }      } } 三、GridControl 中颜色选择控件 private void gvMapColor_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e) {      GridView view = sender as GridView;      DataView dv = view.DataSource as DataView;      if (e.IsGetData)      {          string strVal = dv[e.ListSourceRowIndex]["Color"].ToString();          if (strVal != "")          {              //e.Value = DevExpress.Utils.StyleLayout.ColorFromString(strVal);              e.Value = Common.HexToColor(strVal);          }      }      else      {          //Color colorVal = DevExpress.Utils.StyleLayout.ColorFromString(e.Value.ToString());          Color colorVal = (Color)e.Value;          dv[e.ListSourceRowIndex]["Color"] = Common.RGB_HEX(colorVal.ToArgb());      } } 四、关于 GridControl 验证示例 /**//// /// 初始化GridView,绑定数据 /// /// private void GridViewBindData(string parentId) { this.gridView1.Columns.Clear(); this.FDs= areaSetupActionHelper.getDsRegionByParentId(parentId); this.gridCArea.DataSource =this.FDs.Tables[0].DefaultView;     this.gridView1.Columns["id"].VisibleIndex = -1;     this.gridView1.Columns["childCounts"].VisibleIndex = -1;     this.gridView1.Columns["reg_id"].Caption = "区划编号";     this.gridView1.Columns["reg_name"].Caption = "区划名称";     this.gridView1.Columns["parent_id"].Caption = "父区划编号";     this.gridView1.Columns["reg_desc"].Caption = "区划描述";     this.gridView1.Columns["parent_id"].ImageIndex =1;     this.gridView1.Columns["reg_desc"].ImageIndex = 0;     RepositoryItemTextEdit textEditReg_Id = new RepositoryItemTextEdit();     textEditReg_Id.Mask.EditMask =parentId+"\\d{2,3}";     textEditReg_Id.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Regular;     this.gridView1.Columns["reg_id"].ColumnEdit = textEditReg_Id;     this.gridView1.Columns["reg_desc"].ColumnEdit = new RepositoryItemMemoExEdit();     TreeListNode node = this.treelArea.FocusedNode.ParentNode;     string fid = node==null?"0":node.GetValue("RegID").ToString().Trim();     DataSet ds = areaSetupActionHelper.getDsRegionByParentId(fid);     RepositoryItemLookUpEdit lookUEParent_Id = new RepositoryItemLookUpEdit();     lookUEParent_Id.Columns.Add(new LookUpColumnInfo("reg_id", 40, "区划编号"));     lookUEParent_Id.Columns.Add(new LookUpColumnInfo("reg_name", 40, "区划名称"));     lookUEParent_Id.DataSource = ds.Tables[0].DefaultView;     lookUEParent_Id.ValueMember = "reg_id";     lookUEParent_Id.DisplayMember = "reg_id";     this.gridView1.Columns["parent_id"].ColumnEdit = lookUEParent_Id; } /**//// /// gridView单元格验证的相关处理程序 /// /// /// private void gridView1_ValidatingEditor(object sender, DevExpress.XtraEditors.Controls.BaseContainerValidateEditorEventArgs e) { if (e.Valid == false&this.gridView1.FocusedColumn.FieldName == "reg_id") {       e.ErrorText = "区划编号不合法!\n应为父区划编号加2~3位数据组成!";        }     if (this.gridView1.FocusedColumn.FieldName == "reg_name")     {           Regex reg=new Regex(@"[\u4e00-\u9fa5]{1,20}");      Match m=reg.Match(e.Value.ToString().Trim());      if (m.Length != e.Value.ToString().Trim().Length)      {       e.Valid = false;       e.ErrorText = "区划名称应为汉字\n长度为1至20";      }     } } private void gridView1_InvalidValueException(object sender, InvalidValueExceptionEventArgs e) {     if (MyDialog.Alert(" 您所填写的内容不符合规则\n 要放弃您刚才对此项所做的更改吗?", "您所编辑的内容不符合规则", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)     {      e.ExceptionMode = ExceptionMode.Ignore;     } } /**//// /// gridView行验证的相关处理程序 /// private void gridView1_ValidateRow(object sender, DevExpress.XtraGrid.Views.Base.ValidateRowEventArgs e) { string regid = this.gridView1.GetRowCellValue(e.RowHandle, "reg_id").ToString().Trim(); string regName = this.gridView1.GetRowCellValue(e.RowHandle, "reg_name").ToString().Trim(); if ( regid.Length < 1) {      e.Valid = false;      this.gridView1.SetColumnError(this.gridView1.Columns["reg_id"], "请填写区划编号!", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Default);       // e.ErrorText = "区划名称不能为空!";     }     if (regName.Length < 1)     {      e.Valid = false;      this.gridView1.SetColumnError(this.gridView1.Columns["reg_name"], "区划名称不能为空!", DevExpress.XtraEditors.DXErrorProvider.ErrorType.Default);     } } private void gridView1_InvalidRowException(object sender, DevExpress.XtraGrid.Views.Base.InvalidRowExceptionEventArgs e) {     if (e.RowHandle >= 0)     {      if (this.gridView1.GetRowCellValue(e.RowHandle, this.gridView1.Columns["reg_id"]).ToString().Trim() == "" || this.gridView1.GetRowCellValue(e.RowHandle, this.gridView1.Columns["reg_name"]).ToString().Trim() == "")      {       if (MyDialog.Alert("  您所填写的内容不符合规则\n 要放弃您刚才对此项所做的更改吗?", "您所编辑的内容不符合规则", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)       {        e.ExceptionMode = ExceptionMode.Ignore;       }       else       {        e.ExceptionMode = ExceptionMode.NoAction;       }      }     }     else     {      e.ExceptionMode = ExceptionMode.Ignore;     } }     DevExpress DXperience 是Windows和ASP.NET控件套包、IDE报表生成工具和企业应用程序框架。长期占据着慧都科技控件销量榜的第一位置。在慧都控件网的推动 下,DXperience帮助中国软件企业开发出很多优秀的软件产品 DXperience其产品的品牌、质量,是全球公认的。慧都控件网为 DXperience提供了全面的技术支持服务,同时提供 DXperience从入门到精通的控件培训服务。   同时,慧都为DevExpress for .NET用户量身打造了一款中文资源包,DevExpress 官方汉化资源 , 您只需极少花费便可获得这套完整、专业的汉化资源,从而使您的产品实现全面汉化。   DevExpress中国唯一正式授权的经销商慧都科技透露,DevExpress旗下著名控件套包:DXperience™ Universal Subscription 即将更新到 v2010 vol 1,慧都控件网第一时间提供 DevExpress v2010 vol 1 控件套包下载,如需新版下载请联系慧都控件网。 DevExpress GridControl 动态创建字段及主细关系表过程 2011年05月10日 星期二 下午 08:25 在做项目中,往往需要在查询基类模板窗口内做主细关系Grid,引用一下代码可减少工作量,只需给此过程传递主、细SQL语句以及关联的关键字段即可完成如图所示的效果: #region 执行主细查询过程         public void ExeQuery(string sMSql,string sDSql,string RelaitionField)         {             int iMCountItemNum = 0; int iDCountItemNum = 0;             int iMSumItemNum = 0; int iDSumItemNum = 0;             //查询。             if (sMSql == null || sMSql == "" || sDSql == null || sDSql == "")             {                 return;             }             #region 根据SQL填充主、细表             using (OracleConnection connection = new OracleConnection(DbHelperOra.connectionString))             {                                  _dtQuery = new DataSet();                 try                 {                     connection.Open();                     OracleDataAdapter command = new OracleDataAdapter(sMSql, connection);                     command.Fill(_dtQuery, "MA");                     command.SelectCommand.CommandText=sDSql;                     command.Fill(_dtQuery,"DE");                     command.Dispose();                 }                 catch (System.Data.OracleClient.OracleException ex)                 {                 }                 finally                 {                                    connection.Close();                 }             }             #endregion             #region 主表动态构造字段。             try             {                 //获取到表结构。                 if (_dtQuery.Tables["MA"].Rows.Count >= 0)                 {                     gvMainList.Columns.Clear();                     gvMainList.GroupSummary.Clear();                     gvMainList.ClearGrouping();                     //gvMainList.OptionsBehavior.Editable = true;                     int iVisible = 0;                     //根据表结构动态加载到GridControl控件中。                     foreach (DataColumn _dcQuery in _dtQuery.Tables["MA"].Columns)                     {                         iVisible++;                         //动态添加                         DevExpress.XtraGrid.Columns.GridColumn gcQueryList = new DevExpress.XtraGrid.Columns.GridColumn();                         gcQueryList.Name = "_dc" + _dcQuery.ColumnName.ToUpper();                         gcQueryList.Caption = _dcQuery.ColumnName;                         gcQueryList.FieldName = _dcQuery.ColumnName;                         //数字类型                         if ((_dcQuery.DataType.ToString().ToUpper() == "SYSTEM.DECIMAL" || _dcQuery.DataType.ToString().ToUpper() == "SYSTEM.DOUBLE") &&                             ((gcQueryList.Caption.IndexOf("金额") >= 0) || (gcQueryList.Caption.IndexOf("价格") >= 0)                             || (gcQueryList.Caption.IndexOf("人民币") >= 0) || (gcQueryList.Caption.IndexOf("美元") >= 0)                             || (gcQueryList.Caption.IndexOf("单价") >= 0) || (gcQueryList.Caption.IndexOf("个") >= 0)                             || (gcQueryList.Caption.IndexOf("件") >= 0) || (gcQueryList.Caption.IndexOf("箱") >= 0)                             || (gcQueryList.Caption.IndexOf("数量") >= 0)) && iMSumItemNum < 1)                         {                             iMSumItemNum++;                             gcQueryList.SummaryItem.FieldName = _dcQuery.ColumnName;                             gcQueryList.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;                             gvMainList.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, _dcQuery.ColumnName, null, "  小计:{0}");                         }                         else if ((_dcQuery.DataType.ToString().ToUpper() == "SYSTEM.DECIMAL" || _dcQuery.DataType.ToString().ToUpper() == "SYSTEM.STRING") &&                            ((gcQueryList.Caption.IndexOf("序号") >= 0) || (gcQueryList.Caption.IndexOf("流水") >= 0)                             || (gcQueryList.Caption.IndexOf("ID") >= 0) || (gcQueryList.Caption.IndexOf("编号") >= 0)                             || (gcQueryList.Caption.IndexOf("箱号") >= 0) || (gcQueryList.Caption.IndexOf("尺寸") >= 0)                             || (gcQueryList.Caption.IndexOf("序") >= 0) || (gcQueryList.Caption.IndexOf("单号") >= 0)) && iMCountItemNum < 1)                         {                             iMCountItemNum++;                             gcQueryList.SummaryItem.FieldName = _dcQuery.ColumnName;                             gcQueryList.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count;                             gvMainList.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, _dcQuery.ColumnName, null, "  小计:{0}");                         }                         if (gcQueryList.FieldName != null && RelaitionField != null && gcQueryList.FieldName.ToUpper() != RelaitionField.ToUpper())                         {                             gcQueryList.VisibleIndex = iVisible;                             gcQueryList.Visible = true;                         }                         else                         {                             gcQueryList.VisibleIndex = -1;                             gcQueryList.Visible = false;                         }                         //gcQueryList.ColumnEdit.ReadOnly = true;                         gvMainList.Columns.Add(gcQueryList);                     }                 }                 gcMainList.MainView = gvMainList;               }             catch (System.Exception ex)             {                 MsgBox.ErrorMsg("执行查询失败! 失败原因:" + ex.Message);             }             #endregion             #region 子表构造字段             try             {                 //获取到表结构。                 if (_dtQuery.Tables["DE"].Rows.Count >= 0)                 {                     DevExpress.XtraGrid.Views.Grid.GridView gvMainDetail = new DevExpress.XtraGrid.Views.Grid.GridView();                    // gvMainDetail.Columns.Clear();                    // gvMainDetail.GroupSummary.Clear();                    // gvMainDetail.ClearGrouping();                    // gvMainDetail.OptionsBehavior.Editable = true;                     int iVisible = 0;                     //根据表结构动态加载到GridControl控件中。                     foreach (DataColumn _dcQueryDetail in _dtQuery.Tables["DE"].Columns)                     {                         iVisible++;                         //动态添加                         DevExpress.XtraGrid.Columns.GridColumn gcDetialQueryList = new DevExpress.XtraGrid.Columns.GridColumn();                         gcDetialQueryList.Name = "_dcD" + _dcQueryDetail.ColumnName.ToUpper();                         gcDetialQueryList.Caption = _dcQueryDetail.ColumnName;                         gcDetialQueryList.FieldName = _dcQueryDetail.ColumnName;                         //数字类型                         if ((_dcQueryDetail.DataType.ToString().ToUpper() == "SYSTEM.DECIMAL" || _dcQueryDetail.DataType.ToString().ToUpper() == "SYSTEM.DOUBLE") &&                             ((gcDetialQueryList.Caption.IndexOf("金额") >= 0) || (gcDetialQueryList.Caption.IndexOf("价格") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("人民币") >= 0) || (gcDetialQueryList.Caption.IndexOf("美元") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("单价") >= 0) || (gcDetialQueryList.Caption.IndexOf("个") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("件") >= 0) || (gcDetialQueryList.Caption.IndexOf("箱") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("数量") >= 0)) && iDSumItemNum < 1)                         {                             iDSumItemNum++;                             gcDetialQueryList.SummaryItem.FieldName = _dcQueryDetail.ColumnName;                             gcDetialQueryList.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;                             gvMainDetail.GroupSummary.Add(DevExpress.Data.SummaryItemType.Sum, _dcQueryDetail.ColumnName, null, "  小计:{0}");                         }                         else if ((_dcQueryDetail.DataType.ToString().ToUpper() == "SYSTEM.DECIMAL" || _dcQueryDetail.DataType.ToString().ToUpper() == "SYSTEM.STRING") &&                            ((gcDetialQueryList.Caption.IndexOf("序号") >= 0) || (gcDetialQueryList.Caption.IndexOf("流水") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("ID") >= 0) || (gcDetialQueryList.Caption.IndexOf("编号") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("箱号") >= 0) || (gcDetialQueryList.Caption.IndexOf("尺寸") >= 0)                             || (gcDetialQueryList.Caption.IndexOf("序") >= 0) || (gcDetialQueryList.Caption.IndexOf("单号") >= 0)) && iDCountItemNum < 1)                         {                             iDCountItemNum++;                             gcDetialQueryList.SummaryItem.FieldName = _dcQueryDetail.ColumnName;                             gcDetialQueryList.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count;                             gvMainDetail.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, _dcQueryDetail.ColumnName, null, "  小计:{0}");                         }                         if (gcDetialQueryList.FieldName != null && RelaitionField != null && gcDetialQueryList.FieldName.ToUpper() != RelaitionField.ToUpper())                         {                             gcDetialQueryList.VisibleIndex = iVisible;                             gcDetialQueryList.Visible = true;                         }                         else                         {                             gcDetialQueryList.VisibleIndex = -1;                             gcDetialQueryList.Visible = false;                         }                         //gcDetialQueryList.ColumnEdit.ReadOnly = true;                                                 gvMainDetail.Columns.Add(gcDetialQueryList);                     }                     gcMainList.ViewCollection.Add(gvMainDetail);                 }             }             catch (System.Exception ex)             {                 MsgBox.ErrorMsg("执行查询失败! 失败原因:" + ex.Message);             }             #endregion             #region 建立关系并填充数据源            _dtQuery.Relations.Add("RMD", _dtQuery.Tables["MA"].Columns[RelaitionField], _dtQuery.Tables["DE"].Columns[RelaitionField], false);             gcMainList.DataSource = _dtQuery.Tables["MA"];             gvMainList.BestFitColumns();             #endregion         }         #endregion   效果如图: evExpress 2.0 GridControl 使用方法 2009-02-05 上午 09:11 关于GridControl的几点介绍 1.     它的功能类似与 Visual Studio .NET 2003自带的 DataGrid ,用于数据的客户端展示。开发者可以领用程序控制进行分页现实,分页方法在此不予介绍了。 2.     它与DataGrid的不同就在于其功能的非常强大,可以直接设计报表并可导出为Excel,Txt,Hmtl 格式。免去了再用其他控件设计报表的烦杂。 常用的几个对象 private DevExpress.XtraGrid.GridControl gridControl1;//整个数据容器 private DevExpress.XtraGrid.Views.BandedGrid.BandedGridView bandedGridView1;//显示容器 private DevExpress.XtraGrid.Views.BandedGrid.GridBand gridBand1;//用于设计表头 private DevExpress.XtraGrid.Views.BandedGrid.BandedGridColumn bandedGridColumn1;//用于数据项 之间的关系如下 gridControl1 包含 GridView ,BandedGridView,CarView 以及 AdvBandedGridView,其中bandedGridView又包含 GridBand 和 BandedGridColumn,下面本文以bandedGridView 为列作一使用介绍.  设计样图 步骤一: 将控件拖至设计窗体中,点击 Click here to change view 转换默认gridView为bandedGridView 样式,因为此样式可以给数据设计表头。 步骤二: 点击 Run Designer 进入设计界面入下图   步骤三: 图中 1 框选的按钮功能为添加 数据项bandedGridColumn1 ,根据字段的多少进行添加, 每个字段对应一个数据项。 步骤四:图中 3框选的按钮功能为添加 表头gridBand1,根据需要的数据进行添加。 步骤五: 添加完数据项和表头就需要进行样式设计,即图中2框选的按钮功能。可以自由的进行表头拖动合并,仅需鼠标即可完成,十分方便快捷。如果在字段数量较大的情况,建议使用程序进行控制,因为过多的字段在有限的屏幕中很难控制。 设计过程中gridBand1的放置在表头最底层上bandedGridColumn进行一一对应。为了不显示bandedGridColumn名称,可将属性中的Caption 设置为空字符即一个空格。 代码控制片段 oracleConnection conn = null;              oracleCommand command = null;              try              {                  conn = DBConnection.GetConnection();                  command = new oracleCommand(m_query_elqc_sql,conn);                  oracleDataAdapter oraAdapter = new oracleDataAdapter(command);                  DataSet ds = new DataSet();                  oraAdapter.Fill(ds);                                   if(ds.Tables.Count < 1 ) return ;                  DataTable dt = ds.Tables[0];                  gridControl1.DataSource = dt;                  //绑定数据                  gridColumn1.FieldName = dt.Columns[0].ColumnName;                  gridColumn2.FieldName = dt.Columns[1].ColumnName;                  gridColumn3.FieldName = dt.Columns[2].ColumnName;                  gridColumn4.FieldName = dt.Columns[3].ColumnName;                  gridColumn5.FieldName = dt.Columns[4].ColumnName;                  gridColumn6.FieldName = dt.Columns[5].ColumnName;                  gridColumn7.FieldName = dt.Columns[6].ColumnName;                  gridColumn8.FieldName = dt.Columns[7].ColumnName;                  gridColumn9.FieldName = dt.Columns[8].ColumnName;                  gridColumn10.FieldName = dt.Columns[9].ColumnName;                  gridColumn11.FieldName = dt.Columns[10].ColumnName;                  gridColumn12.FieldName = dt.Columns[11].ColumnName;                  gridColumn13.FieldName = dt.Columns[12].ColumnName;               }              finally              {                  conn.Close(); } 如果需要通过代码进行表头和数据项的设计,可参阅“Windows 窗体设计器生成的代码”中自动生成的方法. 导出报表 仅需如下一步即可完成 this.gridControl1.ExportToExcel(m_savefilename); 存在的不足 1 字段过多不易显示 2 导出报表后字体的样式和表头的背景颜色丢失  DevExpress控件的GridControl控件小结 (由于开始使用DevExpress控件了,所以要点滴的记录一下)   1.DevExpress控件组中的GridControl控件不能使横向滚动条有效。现象:控件中的好多列都挤在一起,列宽都变的很小,根本无法正常浏览控件单元格中的内容。 解决: gridView1.OptionsView.ColumnAutoWidth属性是true,即各列的宽度自动调整,你把它设成false,就会出现了。   2.使单元格不可编辑。 gridcontrol -->gridview -->OptionsBehavior -->Editable=false   3.没有下拉滚动条事件怎么办?现象:因为需要加载大数据量数据,所以不能一次把所有数据读入datatable进行绑定,所以决定在用户进一步浏览数据时进行数据的实时加载工作,就是每当用户拉动滚动条时,多加载一些数据进入datatable.没有找到合适的滚动条事件,于是用这个事件代替了,非常合适我的需求. TopRowChanged事件. 4.获取选定行,指定列单元格的内容         private string GetSelectOID()         {             int[] pRows = this.gridView1.GetSelectedRows();             if (pRows.GetLength(0) > 0)                 return gridView1.GetRowCellValue(pRows[0], mOIDFiledName).ToString ();             else                 return null;         } //mOIDFiledName为要获取列的列名 5.去除"Drag a Column Header Here To Group by that Column" 属性Gridview->Option View->Show Group Panel=false,就好了 6.在gridcontrol中添加checkbox复选框 gridview->run designer->columns->选择要变成复选框的那一列->column edit->new(在这里可以选择很多类型) 加载checkbox数据时,费了一点时间,checkbox的复选框怎么点击,一失去焦点是,选择的操作就无效了,问题就出在datatable的绑定上了,一定要绑定一个布尔的类型. 代码是这样滴! private void FrmCreateLegend_Load(object sender, EventArgs e) {     IFeatureLayer pFeatureLayer;     IDataset pDataset;     string pName;     DataTable pDatatable = new DataTable();     pDatatable.Columns.Add("图层名称", System.Type.GetType("System.String"));     pDatatable.Columns.Add("选择", System.Type.GetType("System.Boolean"));     DataRow pDataRow;     object[] rowArray = new object[2];     for (int i = 0; i < mFeatureLayers.Count; i++)     {         pDataRow = pDatatable.NewRow();         pFeatureLayer = mFeatureLayers[i] as IFeatureLayer;         rowArray[0] = pFeatureLayer.Name;         rowArray[1] = false;         pDataRow.ItemArray = rowArray;         pDatatable.Rows.Add(pDataRow);     }     this.gridMark.DataSource = pDatatable;     this.gridMark.Refresh(); } 注意:创建的datatable的列名一定要和gridview中的列的fieldname属性值是一个名字,不然,你会发现添加了和你绑定的datatalbe一样多的行,可是行里面却没有内容的. 7.多选 GridControl->GridView->属性->OptinosSelecttion->MultiSelect  8.不显示子表信息 当我们对DataTable建立父子关系后,将父表绑定在Grid上,会造成关系列上有加号显示,并且可以展开.如果你觉得展开的信息对你没有意义的话,是可以关掉的.这是需要修改属性 属性Gridview->Option View->ShowDetailButtons=false                                    C# - Winform - DevExpress - GridControl 任意条件控制Row背景色。 2010年09月17日 星期五 下午 02:16 代码: private void gvSendConfirm_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)         {             string sCurrTime=DbHelperSql.GetSingle("Select GetDate() DateNow").ToString();             DateTime dtCurrTime,dtSendTime;             int iMinutes = 0;             try             {                 dtCurrTime=DateTime.Parse(sCurrTime);             }             catch (System.Exception ex)             {             dtCurrTime=DateTime.Now;             }             string sSendTime= gvSendConfirm.GetDataRow(e.RowHandle)["UpdateTime"].ToString();             try             {                 dtSendTime = DateTime.Parse(sSendTime);             }             catch (System.Exception ex)             {                 dtSendTime = DateTime.Now;             }             //计算时间差。             System.TimeSpan difTime = dtCurrTime.Subtract(dtSendTime);             iMinutes = difTime.Minutes;             if (iMinutes <= iTimeOutLevel1)             {                 e.Appearance.BackColor = Color.White;   //设置背景色             }             else if (iMinutes > iTimeOutLevel1 && iMinutes <= iTimeOutLevel2)             {                 e.Appearance.BackColor = Color.FromArgb(192, 192, 255);//设置背景色             }             else if (iMinutes > iTimeOutLevel2 && iMinutes <= iTimeOutLevel3)             {                 e.Appearance.BackColor = Color.FromArgb(128, 255, 128);//设置背景色             }             else if (iMinutes > iTimeOutLevel3 && iMinutes <= iTimeOutLevel4)             {                 e.Appearance.BackColor = Color.FromArgb(255, 192, 128);//设置背景色             }             else if (iMinutes > iTimeOutLevel4 && iMinutes <= iTimeOutLevel5)             {                 e.Appearance.BackColor = Color.FromArgb(255, 128, 128);//设置背景色             }             else if (iMinutes > iTimeOutLevel5 && iMinutes <= iTimeOutLevel6)             {                 e.Appearance.BackColor = Color.Red;//设置背景色             }             else if (iMinutes > iTimeOutLevel6)             {                 e.Appearance.BackColor = Color.Crimson;//设置背景色             }             e.Appearance.ForeColor = Color.Black; //设置字体颜色         } [转] DevExpress 第三方控件汉化的全部代码和使用方法 作者:查小广  来源:博客园  发布时间:2009-05-13 16:06  阅读:1362 次  原文链接   [收藏]     DevExpress.XtraEditors.Controls  此控件包中包含的控件最多,包括文本框,下拉列表,按钮,等等        DevExpress.XtraGrid 网格        DevExpress.XtraBars 菜单栏 和 工具栏        DevExpress.XtraNavBar 导航条        DevExpress.XtraPrinting 报表打印相关        DevExpress.XtraReports 报表      DevExpress.XtraTreeList 树      DevExpress.XtraVerticalGrid    使用方法:         1.先将该类生成的Dll导入工程中 ,也可以不生成dll,把该类放到项目中就行了。       2.在你的From_Load()或者program.cs中实例化该类即可            具体代码如下:    new ChineseLanguage.Chinese();        3.据我测试,好像适合很多版本,如果只用到其中一部分的控件,可以注释掉一些。 using System;    using DevExpress.XtraEditors.Controls;    using DevExpress.XtraGrid.Localization; using DevExpress.XtraBars.Customization; using DevExpress.XtraBars.Localization; using DevExpress.XtraNavBar; using DevExpress.XtraPrinting.Localization; using DevExpress.XtraReports.Localization; using DevExpress.XtraTreeList.Localization; using DevExpress.XtraVerticalGrid.Localization; namespace ChineseLanguage {     public class Chinese     {         public Chinese()         {             Localizer.Active = new XtraEditors_CN();             GridLocalizer.Active = new XtraGrid_CN();             BarLocalizer.Active = new XtraBar_CN();             BarLocalizer.Active.Customization = new XtraBarsCustomizationLocalization_CN();             NavBarLocalizer.Active = new XtraNavBar_CN();             PreviewLocalizer.Active = new XtraPrinting_CN();             ReportLocalizer.Active = new XtraReports_CN();             TreeListLocalizer.Active = new XtraTreeList_CN();             VGridLocalizer.Active = new XtraVerticalGrid_CN();         }     }     public class XtraEditors_CN :Localizer     {         public XtraEditors_CN()         {             //             // TODO: 在此处添加构造函数逻辑             //         }         public override string Language         {              get             {                 return "简体中文";             }         }         public override string GetLocalizedString(StringId id)            {                switch(id)                  {                  case StringId.TextEditMenuCopy:return "复制(&C)";                 case StringId.TextEditMenuCut:return "剪切(&T)";                 case StringId.TextEditMenuDelete:return "删除(&D)";                 case StringId.TextEditMenuPaste:return "粘贴(&P)";                 case StringId.TextEditMenuSelectAll:return "全选(&A)";                 case StringId.TextEditMenuUndo:return "撤消(&U)";                 case StringId.UnknownPictureFormat:return "未知图片格式";                 case StringId.DateEditToday:return "今天";                 case StringId.DateEditClear:return "清空";                 case StringId.DataEmpty:return "无图像";                 case StringId.ColorTabWeb:return "网页";                 case StringId.ColorTabSystem:return "系统";                 case StringId.ColorTabCustom:return "自定义";                 case StringId.CheckUnchecked:return "未选择";                 case StringId.CheckIndeterminate:return "不确定";                 case StringId.CheckChecked:return "已选择";                 case StringId.CaptionError:return "标题错误";                 case StringId.Cancel:return "取消";                 case StringId.CalcError:return "计算错误";                 case StringId.CalcButtonBack:return base.GetLocalizedString(id);                 case StringId.CalcButtonC:return base.GetLocalizedString(id);                 case StringId.CalcButtonCE:return base.GetLocalizedString(id);;                 case StringId.CalcButtonMC:return base.GetLocalizedString(id);                 case StringId.CalcButtonMR:return base.GetLocalizedString(id);                 case StringId.CalcButtonMS:return base.GetLocalizedString(id);                 case StringId.CalcButtonMx:return base.GetLocalizedString(id);                 case StringId.CalcButtonSqrt:return base.GetLocalizedString(id);                  case StringId.OK:return "确定";                 case StringId.PictureEditMenuCopy:return "复制(&C)";                 case StringId.PictureEditMenuCut:return "剪切(&T)";                 case StringId.PictureEditMenuDelete:return "删除(&D)";                 case StringId.PictureEditMenuLoad:return "加载(&L)";                 case StringId.PictureEditMenuPaste:return "粘贴(&P)";                 case StringId.PictureEditMenuSave:return "保存(&S)";                 case StringId.PictureEditOpenFileError:return "错误图片格式";                 case StringId.PictureEditOpenFileErrorCaption:return "打开错误";                 case StringId.PictureEditOpenFileFilter:return "位图文件(*.bmp)|*.bmp|GIF动画 (*.gif)|*.gif|JPEG(*.jpg;*.jpeg)|*.jpg;*.jpeg|ICO(*.ico)|*.ico|所有图片文件|*.bmp;*.gif;*.jpeg;*.jpg;*.ico|所有文件(*.*)|*.*";                 case StringId.PictureEditOpenFileTitle:return "打开";                 case StringId.PictureEditSaveFileFilter:return "位图文件(*.bmp)|*.bmp|GIF动画(*.gif)|*.gif|JPEG(*.jpg)|*.jpg";                 case StringId.PictureEditSaveFileTitle:return "保存为";                 case StringId.TabHeaderButtonClose:return "关闭";                 case StringId.TabHeaderButtonNext:return "下一页";                 case StringId.TabHeaderButtonPrev:return "上一页";                 case StringId.XtraMessageBoxAbortButtonText:return "中断(&A)";                 case StringId.XtraMessageBoxCancelButtonText:return "取消(&C)";                 case StringId.XtraMessageBoxIgnoreButtonText:return "忽略(&I)";                 case StringId.XtraMessageBoxNoButtonText:return "否(&N)";                 case StringId.XtraMessageBoxOkButtonText:return "确定(&O)";                 case StringId.XtraMessageBoxRetryButtonText:return "重试(&R)";                 case StringId.XtraMessageBoxYesButtonText:return "是(&Y)";                 case StringId.ImagePopupEmpty:return "(空)";                 case StringId.ImagePopupPicture:return "(图片)";                 case StringId.InvalidValueText:return "无效的值";                 case StringId.LookUpEditValueIsNull:return "[无数据]";                 case StringId.LookUpInvalidEditValueType:return "无效的数据类型";                 case StringId.MaskBoxValidateError:return "输入数值不完整. 是否须要修改? 是 - 回到编辑模式以修改数值. 否 - 保持原来数值. 取消 - 回复原来数值. ";                 case StringId.NavigatorAppendButtonHint:return "添加";                 case StringId.NavigatorCancelEditButtonHint:return "取消编辑";                 case StringId.NavigatorEditButtonHint:return "编辑";                 case StringId.NavigatorEndEditButtonHint:return "结束编辑";                  case StringId.NavigatorFirstButtonHint:return "第一条";                 case StringId.NavigatorLastButtonHint:return "最后一条";                 case StringId.NavigatorNextButtonHint:return "下一条";                 case StringId.NavigatorNextPageButtonHint:return "下一页";                 case StringId.NavigatorPreviousButtonHint:return "上一条";                 case StringId.NavigatorPreviousPageButtonHint:return "上一页";                 case StringId.NavigatorRemoveButtonHint:return "删除";                 case StringId.NavigatorTextStringFormat:return "记录{0}/{1}";                 case StringId.None:return "";                 case StringId.NotValidArrayLength:return "无效的数组长度.";             }             return base.GetLocalizedString(id);         }     }               public class XtraGrid_CN :GridLocalizer      {         public override string Language         {             get             {                 return "简体中文";             }         }                  public override string GetLocalizedString(GridStringId id)         {             switch(id)             {                 case GridStringId.CardViewNewCard:return "新卡片";                 case GridStringId.CardViewQuickCustomizationButton:return "自定义格式";                 case GridStringId.CardViewQuickCustomizationButtonFilter:return "筛选";                 case GridStringId.CardViewQuickCustomizationButtonSort:return "排序";                     case GridStringId.ColumnViewExceptionMessage:return "是否确定修改?";                  case GridStringId.CustomFilterDialog2FieldCheck:return "字段";                 case GridStringId.CustomFilterDialogCancelButton:return "取消";                 case GridStringId.CustomFilterDialogCaption:return "条件为:";                 case GridStringId.CustomFilterDialogConditionBlanks:return "空值";                 case GridStringId.CustomFilterDialogConditionEQU:return "等于=";                 case GridStringId.CustomFilterDialogConditionGT:return "大于>";                 case GridStringId.CustomFilterDialogConditionGTE:return "大于或等于>=";                 case GridStringId.CustomFilterDialogConditionLike:return "包含";                 case GridStringId.CustomFilterDialogConditionLT:return "小于<";                 case GridStringId.CustomFilterDialogConditionLTE:return "小于或等于>=";                 case GridStringId.CustomFilterDialogConditionNEQ:return "不等于<>";                 case GridStringId.CustomFilterDialogConditionNonBlanks:return "非空值";                 case GridStringId.CustomFilterDialogConditionNotLike:return "不包含";                 case GridStringId.CustomFilterDialogFormCaption:return "清除筛选条件(&L)";                 case GridStringId.CustomFilterDialogOkButton:return "确定(&O)";                 case GridStringId.CustomFilterDialogRadioAnd:return "和(&A)";                 case GridStringId.CustomFilterDialogRadioOr:return "或者(&O)";                 case GridStringId.CustomizationBands:return "分区";                 case GridStringId.CustomizationCaption:return "自定义显示字段";                 case GridStringId.CustomizationColumns:return "列";                 case GridStringId.FileIsNotFoundError:return "文件{0}没找到!";                 case GridStringId.GridGroupPanelText:return "拖曳一列页眉在此进行排序";                 case GridStringId.GridNewRowText:return "单击这里新增一行";                 case GridStringId.GridOutlookIntervals:return "一个月以上;上个月;三周前;两周前;上周;;;;;;;;昨天;今天;明天; ;;;;;;;下周;两周后;三周后;下个月;一个月之后;";                 case GridStringId.MenuColumnBestFit:return "自动调整字段宽度";                 case GridStringId.MenuColumnBestFitAllColumns:return "自动调整所有字段宽度";                 case GridStringId.MenuColumnClearFilter:return "清除筛选条件";                 case GridStringId.MenuColumnColumnCustomization:return "显示/隐藏字段";                 case GridStringId.MenuColumnFilter:return "筛选";                 case GridStringId.MenuColumnGroup:return "按此列分组";                 case GridStringId.MenuColumnGroupBox:return "分组区";                 case GridStringId.MenuColumnSortAscending:return "升序排序";                 case GridStringId.MenuColumnSortDescending:return "降序排序";                 case GridStringId.MenuColumnUnGroup:return "取消分组";                 case GridStringId.MenuFooterAverage:return "平均";                  case GridStringId.MenuFooterAverageFormat:return "平均={0:#.##}";                 case GridStringId.MenuFooterCount:return "计数";                 case GridStringId.MenuFooterCountFormat:return "{0}";                 case GridStringId.MenuFooterMax:return "最大值";                 case GridStringId.MenuFooterMaxFormat:return "最大值={0}";                 case GridStringId.MenuFooterMin:return "最小";                 case GridStringId.MenuFooterMinFormat:return "最小值={0}";                 case GridStringId.MenuFooterNone:return "没有";                 case GridStringId.MenuFooterSum:return "合计";                 case GridStringId.MenuFooterSumFormat:return "求和={0:#.##}";                 case GridStringId.MenuGroupPanelClearGrouping:return "取消所有分组";                 case GridStringId.MenuGroupPanelFullCollapse:return "收缩全部分组";                 case GridStringId.MenuGroupPanelFullExpand:return "展开全部分组";                 case GridStringId.PopupFilterAll:return "(所有)";                 case GridStringId.PopupFilterBlanks:return "(空值)";                 case GridStringId.PopupFilterCustom:return "(自定义)";                 case GridStringId.PopupFilterNonBlanks:return "(非空值)";                 case GridStringId.PrintDesignerBandedView:return "打印设置(区域模式)";                 case GridStringId.PrintDesignerBandHeader:return "区标题";                 case GridStringId.PrintDesignerCardView:return "打印设置(卡片模式)";                 case GridStringId.PrintDesignerDescription:return "为当前视图设置不同的打印选项.";                 case GridStringId.PrintDesignerGridView:return "打印设置(表格模式)";                 case GridStringId.WindowErrorCaption:return "错误";             }             return base.GetLocalizedString(id);         }     }          public class XtraBar_CN :BarLocalizer     {         public override string Language         {             get             {                 return "简体中文";             }         }         public override string GetLocalizedString(BarString id)         {             switch(id)             {                 case BarString.AddOrRemove:return "新增或删除按钮(&A)";                 case BarString.CustomizeButton:return "自定义(&C)";                 case BarString.CustomizeWindowCaption:return "自定义";                 case BarString.MenuAnimationFade:return "减弱";                 case BarString.MenuAnimationNone:return "空";                 case BarString.MenuAnimationRandom:return "任意";                 case BarString.MenuAnimationSlide:return "滑动";                 case BarString.MenuAnimationSystem:return "(系统默认值)";                 case BarString.MenuAnimationUnfold:return  "展开";                 case BarString.NewToolbarCaption:return "新建工具栏";                 case BarString.None:return "";                 case BarString.RenameToolbarCaption:return "重新命名";                 case BarString.ResetBar:return "是否确实要重置对 '{0}' 工具栏所作的修改?";                 case BarString.ResetBarCaption:return "自定义";                 case BarString.ResetButton:return "重设工具栏(&R)";                 case BarString.ToolBarMenu:return "重设(&R)$删除(&D)$!命名(&N)$!标准(&L)$总使用文字(&T)$在菜单中只用文字(&O)$图像与文本(&A)$!开始一组(&G)$常用的(&M)";                 case BarString.ToolbarNameCaption:return "工具栏名称(&T):";             }             return base.GetLocalizedString(id);         }     }     public class XtraBarsCustomizationLocalization_CN : CustomizationControl     {         private System.ComponentModel.Container components = null;         public XtraBarsCustomizationLocalization_CN()         {             // This call is required by the Windows.Forms Form Designer.             InitializeComponent();             // TODO: Add any initialization after the InitForm call         }         protected override void Dispose(bool disposing)         {             if (disposing)             {                 if (components != null)                 {                     components.Dispose();                 }             }             base.Dispose(disposing);         }         #region Component Designer generated code         ///           /// Required method for Designer support - do not modify          /// the contents of this method with the code editor.         ///          private void InitializeComponent()         {             this.tpOptions.SuspendLayout();             this.tpCommands.SuspendLayout();             this.tpToolbars.SuspendLayout();             ((System.ComponentModel.ISupportInitialize)(this.toolBarsList)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.lbCommands)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.lbCategories)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptionsShowFullMenus.Properties)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_showFullMenusAfterDelay.Properties)).BeginInit();             ((System.ComponentModel.ISupportInitialize)( this.cbOptions_showTips.Properties)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_ShowShortcutInTips.Properties)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.tabControl)).BeginInit();             this.tabControl.SuspendLayout();             ((System.ComponentModel.ISupportInitialize)(this.tbNBDlgName.Properties)).BeginInit();             this.pnlNBDlg.SuspendLayout();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_largeIcons.Properties)).BeginInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_MenuAnimation.Properties)).BeginInit();             this.SuspendLayout();                          this.btClose.Text = "关闭";             this.btResetBar.Text = "重新设置(&R)";             this.btRenameBar.Text = "重命名(&E)";             this.btNewBar.Text = "新建(&N)";             this.btDeleteBar.Text = "删除(&D)";             this.btOptions_Reset.Text = "重置惯用数据(&R)";             this.btNBDlgCancel.Text = "取消";             this.btNBDlgOk.Text = "确定";             this.tpOptions.Size = new System.Drawing.Size(354, 246);             this.tpOptions.Text = "选项(&O)";             this.tpCommands.Text = "命令(&C)";             this.tpToolbars.Text = "工具栏(&B)";                         this.cbOptionsShowFullMenus.Properties.Caption = "始终显示整个菜单(&N)";             this.cbOptions_showFullMenusAfterDelay.Properties.Caption = "鼠标指针短暂停留后显示完整菜单(&U)";             this.cbOptions_largeIcons.Properties.Caption = "大图标(&L)";             this.cbOptions_showTips.Properties.Caption = "显示关于工具栏屏幕提示(&T)";             this.cbOptions_ShowShortcutInTips.Properties.Caption = "在屏幕提示中显示快捷键(&H)";             this.lbDescCaption.Text = "详细说明";             this.lbOptions_Other.Text = "其它";              this.lbOptions_PCaption.Text = "个性化菜单和工具栏";             this.lbCategoriesCaption.Text = "类别:";             this.lbCommandsCaption.Text = "命令:";             this.lbToolbarCaption.Text = "工具栏:";             this.lbOptions_MenuAnimation.Text = "菜单动画设置(&M):";             this.lbNBDlgCaption.Text = "工具栏名称(&T)";             this.lbCommands.Appearance.BackColor = System.Drawing.SystemColors.Window;             this.lbCommands.Appearance.Options.UseBackColor = true;             this.Name = "XtraBarsCustomizationLocalization_CN";             this.tpOptions.ResumeLayout(false);             this.tpCommands.ResumeLayout(false);             this.tpToolbars.ResumeLayout(false);             ((System.ComponentModel.ISupportInitialize)(this.toolBarsList)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.lbCommands)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.lbCategories)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptionsShowFullMenus.Properties)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_showFullMenusAfterDelay.Properties)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_showTips.Properties)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_ShowShortcutInTips.Properties)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.tabControl)).EndInit();             this.tabControl.ResumeLayout(false);             ((System.ComponentModel.ISupportInitialize)(this.tbNBDlgName.Properties)).EndInit();             this.pnlNBDlg.ResumeLayout(false);             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_largeIcons.Properties)).EndInit();             ((System.ComponentModel.ISupportInitialize)(this.cbOptions_MenuAnimation.Properties)).EndInit();             this.ResumeLayout(false);         }         #endregion     }     public class XtraNavBar_CN :NavBarLocalizer     {         public override string Language         {             get             {                 return "简体中文";             }         }                  public override string GetLocalizedString(NavBarStringId id)         {             switch(id)             {                 case NavBarStringId.NavPaneChevronHint:return "配置按钮";                 case NavBarStringId.NavPaneMenuAddRemoveButtons:return "添加或删除按钮(&A)";                 case NavBarStringId.NavPaneMenuShowFewerButtons:return "显示较少的按钮(&F)";                 case NavBarStringId.NavPaneMenuShowMoreButtons:return "显示更多的按钮(&M)";             }             return base.GetLocalizedString(id);         }     }     public class XtraPrinting_CN :PreviewLocalizer     {         public override string Language         {             get             {                 return "简体中文";             }         }         public override string GetLocalizedString(PreviewStringId id)         {             switch(id)             {                 case PreviewStringId.Button_Apply:return "应用";                 case PreviewStringId.Button_Cancel:return "取消";                 case PreviewStringId.Button_Help:return "帮助";                 case PreviewStringId.Button_Ok:return "确定";                 case PreviewStringId.EMail_From:return "From";                 case PreviewStringId.Margin_BottomMargin:return "下边界";                 case PreviewStringId.Margin_Inch:return "英寸";                 case PreviewStringId.Margin_LeftMargin:return "左边界";                 case PreviewStringId.Margin_Millimeter:return "毫米";                 case PreviewStringId.Margin_RightMargin:return "右边界";                 case PreviewStringId.Margin_TopMargin:return "上边界";                 case PreviewStringId.MenuItem_BackgrColor:return "颜色(&C)";                 case PreviewStringId.MenuItem_Background:return "背景(&B)";                 case PreviewStringId.MenuItem_CsvDocument:return "CSV文件";                 case PreviewStringId.MenuItem_Exit:return "退出(&X)";                 case PreviewStringId.MenuItem_Export:return "导出(&E)";                 case PreviewStringId.MenuItem_File: return "文件(&F)";                 case PreviewStringId.MenuItem_GraphicDocument:return "图片文件";                 case PreviewStringId.MenuItem_HtmDocument:return "HTML文件";                 case PreviewStringId.MenuItem_MhtDocument:return "MHT文件";                 case PreviewStringId.MenuItem_PageSetup:return "页面设置(&U)";                 case PreviewStringId.MenuItem_PdfDocument:return "PDF文件";                 case PreviewStringId.MenuItem_Print:return "打印(&P)";                 case PreviewStringId.MenuItem_PrintDirect:return "直接打印(&R)";                 case PreviewStringId.MenuItem_RtfDocument:return "RTF文件";                 case PreviewStringId.MenuItem_Send:return "发送(&D)";                 case PreviewStringId.MenuItem_TxtDocument:return "TXT文件";                 case PreviewStringId.MenuItem_View:return "视图(&V)";                 case PreviewStringId.MenuItem_ViewStatusbar:return "状态栏(&S)";                 case PreviewStringId.MenuItem_ViewToolbar:return "工具栏(&T)";                 case PreviewStringId.MenuItem_Watermark:return "水印(&W)";                  case PreviewStringId.MenuItem_XlsDocument:return "XLS文件";                 case PreviewStringId.MPForm_Lbl_Pages:return "页";                 case PreviewStringId.Msg_CreatingDocument:return "正在生成文件";                 case PreviewStringId.Msg_CustomDrawWarning:return "警告!";                 case PreviewStringId.Msg_EmptyDocument:return "此文件没有页面.";                 case PreviewStringId.Msg_FontInvalidNumber:return "字体大小不能为0或负数";                 case PreviewStringId.Msg_IncorrectPageRange:return "设置的页边界不正确";                 case PreviewStringId.Msg_NeedPrinter:return "没有安装打印机.";                 case PreviewStringId.Msg_NotSupportedFont:return "这种字体不被支持";                 case PreviewStringId.Msg_PageMarginsWarning:return "一个或以上的边界超出了打印范围.是否继续?";                 case PreviewStringId.Msg_WrongPageSettings:return "打印机不支持所选的纸张大小. 是否继续打印?";                 case PreviewStringId.Msg_WrongPrinter:return "无效的打印机名称.请检查打印机的设置是否正确.";                 case PreviewStringId.PageInfo_PageDate:return "[Date Printed]";                 case PreviewStringId.PageInfo_PageNumber:return "[Page #]";                 case PreviewStringId.PageInfo_PageNumberOfTotal:return "[Page # of Pages #]";                 case PreviewStringId.PageInfo_PageTime:return "[Time Printed]";                 case PreviewStringId.PageInfo_PageUserName:return "[User Name]";                 case PreviewStringId.PreviewForm_Caption:return "预览";                 case PreviewStringId.SaveDlg_FilterBmp:return "BMP Bitmap Format";                 case PreviewStringId.SaveDlg_FilterCsv:return "CSV文件";                 case PreviewStringId.SaveDlg_FilterGif:return "GIF Graphics Interchange Format";                 case PreviewStringId.SaveDlg_FilterHtm:return "HTML文件";                 case PreviewStringId.SaveDlg_FilterJpeg:return "JPEG File Interchange Format";                 case PreviewStringId.SaveDlg_FilterMht:return "MHT文件";                 case PreviewStringId.SaveDlg_FilterPdf:return "PDF文件";                 case PreviewStringId.SaveDlg_FilterPng:return "PNG Portable Network Graphics Format";                 case PreviewStringId.SaveDlg_FilterRtf:return "RTF文件";                 case PreviewStringId.SaveDlg_FilterTiff:return "TIFF Tag Image File Format";                 case PreviewStringId.SaveDlg_FilterTxt:return "TXT文件";                  case PreviewStringId.SaveDlg_FilterWmf:return "WMF Windows Metafile";                 case PreviewStringId.SaveDlg_FilterXls:return "Excel文件";                 case PreviewStringId.SaveDlg_Title:return "另存为";                 case PreviewStringId.SB_CurrentPageNo:return "目前页码:";                 case PreviewStringId.SB_PageInfo:return "{0}/{1}";                 case PreviewStringId.SB_PageNone:return "无";                 case PreviewStringId.SB_TotalPageNo:return "总页码:";                 case PreviewStringId.SB_ZoomFactor:return "缩放系数:";                 case PreviewStringId.ScrollingInfo_Page:return "页";                 case PreviewStringId.TB_TTip_Backgr:return "背景色";                 case PreviewStringId.TB_TTip_Close:return "退出";                 case PreviewStringId.TB_TTip_Customize:return "自定义";                 case PreviewStringId.TB_TTip_EditPageHF:return "页眉页脚";                 case PreviewStringId.TB_TTip_Export:return "导出文件";                 case PreviewStringId.TB_TTip_FirstPage:return "首页";                 case PreviewStringId.TB_TTip_HandTool:return "手掌工具";                 case PreviewStringId.TB_TTip_LastPage:return "尾页";                 case PreviewStringId.TB_TTip_Magnifier:return "放大/缩小";                 case PreviewStringId.TB_TTip_Map:return "文档视图";                 case PreviewStringId.TB_TTip_MultiplePages:return "多页";                 case PreviewStringId.TB_TTip_NextPage:return "下一页";                 case PreviewStringId.TB_TTip_PageSetup:return "页面设置";                 case PreviewStringId.TB_TTip_PreviousPage:return "上一页";                 case PreviewStringId.TB_TTip_Print:return "打印";                 case PreviewStringId.TB_TTip_PrintDirect:return "直接打印";                 case PreviewStringId.TB_TTip_Search:return "搜索";                 case PreviewStringId.TB_TTip_Send:return "发送E-Mail";                 case PreviewStringId.TB_TTip_Watermark:return "水印";                 case PreviewStringId.TB_TTip_Zoom:return "缩放";                 case PreviewStringId.TB_TTip_ZoomIn:return "放大";                 case PreviewStringId.TB_TTip_ZoomOut:return "缩小";                 case PreviewStringId.WMForm_Direction_BackwardDiagonal:return "反向倾斜";                 case PreviewStringId.WMForm_Direction_ForwardDiagonal:return "正向倾斜";                 case PreviewStringId.WMForm_Direction_Horizontal:return "横向";                 case PreviewStringId.WMForm_Direction_Vertical:return "纵向";                 case PreviewStringId.WMForm_HorzAlign_Center:return "置中";                 case PreviewStringId.WMForm_HorzAlign_Left:return "靠左";                  case PreviewStringId.WMForm_HorzAlign_Right:return "靠右";                 case PreviewStringId.WMForm_ImageClip:return "剪辑";                 case PreviewStringId.WMForm_ImageStretch:return "伸展";                 case PreviewStringId.WMForm_ImageZoom:return "缩放";                 case PreviewStringId.WMForm_PageRangeRgrItem_All:return "全部";                 case PreviewStringId.WMForm_PageRangeRgrItem_Pages:return "页码";                 case PreviewStringId.WMForm_PictureDlg_Title:return "选择图片";                 case PreviewStringId.WMForm_VertAlign_Bottom:return "底端";                 case PreviewStringId.WMForm_VertAlign_Middle:return "中间";                 case PreviewStringId.WMForm_VertAlign_Top:return "顶端";                 case PreviewStringId.WMForm_Watermark_Asap:return "ASAP";                 case PreviewStringId.WMForm_Watermark_Confidential:return "CONFIDENTIAL";                 case PreviewStringId.WMForm_Watermark_Copy:return "COPY";                 case PreviewStringId.WMForm_Watermark_DoNotCopy:return "DO NOT COPY";                 case PreviewStringId.WMForm_Watermark_Draft:return "DRAFT";                 case PreviewStringId.WMForm_Watermark_Evaluation:return "EVALUATION";                 case PreviewStringId.WMForm_Watermark_Original:return "ORIGINAL";                 case PreviewStringId.WMForm_Watermark_Personal:return "PERSONAL";                 case PreviewStringId.WMForm_Watermark_Sample:return "SAMPLE";                 case PreviewStringId.WMForm_Watermark_TopSecret:return "TOP SECRET";                 case PreviewStringId.WMForm_Watermark_Urgent:return "URGENT";                 case PreviewStringId.WMForm_ZOrderRgrItem_Behind:return "在后面";                 case PreviewStringId.WMForm_ZOrderRgrItem_InFront:return "在前面";             }             return base.GetLocalizedString(id);         }     }     public class XtraReports_CN :ReportLocalizer     {         public override string Language         {             get             {                 return "简体中文";             }         }         public override string GetLocalizedString(ReportStringId id)         {             switch(id)             {                 case ReportStringId.BandDsg_QuantityPerPage:return "一个页面集合";                 case ReportStringId.BandDsg_QuantityPerReport:return "一个报表集合";                 case ReportStringId.BCForm_Lbl_Binding:return "结合";                 case ReportStringId.BCForm_Lbl_Property:return "属性";                 case ReportStringId.CatAppearance:return "版面";                 case ReportStringId.CatBehavior:return "状态";                 case ReportStringId.CatData:return "数据";                 case ReportStringId.CatLayout:return "布局";                 case ReportStringId.CatNavigation:return "导航";                 case ReportStringId.CatPageSettings:return "页面设置";                 case ReportStringId.Cmd_AlignToGrid:return "对齐网格线";                 case ReportStringId.Cmd_BottomMargin:return "底端边缘";                 case ReportStringId.Cmd_BringToFront:return "移到最上层";                 case ReportStringId.Cmd_Copy:return "复制";                 case ReportStringId.Cmd_Cut:return "剪贴";                 case ReportStringId.Cmd_Delete:return "删除";                 case ReportStringId.Cmd_Detail:return "详细";                 case ReportStringId.Cmd_DetailReport:return "详细报表";                 case ReportStringId.Cmd_GroupFooter:return "群组尾";                 case ReportStringId.Cmd_GroupHeader:return "群组首";                 case ReportStringId.Cmd_InsertBand:return "插入区段";                 case ReportStringId.Cmd_InsertDetailReport:return "插入详细报表";                 case ReportStringId.Cmd_InsertUnboundDetailReport:return "非绑定";                 case ReportStringId.Cmd_PageFooter:return "页尾";                 case ReportStringId.Cmd_PageHeader:return "页首";                 case ReportStringId.Cmd_Paste:return "粘贴";                 case ReportStringId.Cmd_Properties:return "属性";                 case ReportStringId.Cmd_ReportFooter:return "报表尾";                 case ReportStringId.Cmd_ReportHeader:return "报表首";                 case ReportStringId.Cmd_RtfClear:return "清除";                  case ReportStringId.Cmd_RtfLoad:return "加载文件";                 case ReportStringId.Cmd_SendToBack:return "移到最下层";                 case ReportStringId.Cmd_TableDelete:return "删除(&L)";                 case ReportStringId.Cmd_TableDeleteCell:return "单元格(&L)";                 case ReportStringId.Cmd_TableDeleteColumn:return "列(&C)";                 case ReportStringId.Cmd_TableDeleteRow:return "行(&R)";                 case ReportStringId.Cmd_TableInsert:return "插入(&I)";                 case ReportStringId.Cmd_TableInsertCell:return "单元格(&C)";                 case ReportStringId.Cmd_TableInsertColumnToLeft:return "左列(&L)";                 case ReportStringId.Cmd_TableInsertColumnToRight:return "右列(&R)";                 case ReportStringId.Cmd_TableInsertRowAbove:return "上行(&A)";                 case ReportStringId.Cmd_TableInsertRowBelow:return "下行(&B)";                 case ReportStringId.Cmd_TopMargin:return "顶端边缘";                 case ReportStringId.Cmd_ViewCode:return "检视代码";                 case ReportStringId.FindForm_Msg_FinishedSearching:return "搜索文件完成";                 case ReportStringId.FindForm_Msg_TotalFound:return "合计查找:";                 case ReportStringId.FSForm_Btn_Delete:return "删除";                 case ReportStringId.FSForm_GrBox_Sample:return "范例";                 case ReportStringId.FSForm_Lbl_Category:return "类别";                 case ReportStringId.FSForm_Lbl_CustomGeneral:return "一般格式不包含特殊数字格式";                 case ReportStringId.FSForm_Lbl_Prefix:return "上标";                 case ReportStringId.FSForm_Lbl_Suffix:return "下标";                 case ReportStringId.FSForm_Msg_BadSymbol:return "损坏的符号";                 case ReportStringId.FSForm_Tab_Custom:return "自定义";                 case ReportStringId.FSForm_Tab_StandardTypes:return "标准类型";                 case ReportStringId.Msg_CantFitBarcodeToControlBounds:return "条形码控件的边界太小";                 case ReportStringId.Msg_CreateReportInstance:return "您试图打开一个不同类型的报表来编辑。是否确定建立实例?";                 case ReportStringId.Msg_CreateSomeInstance:return "在窗体中不能建立两个实例类。";                 case ReportStringId.Msg_CyclicBoormarks:return "报表循环书签";                 case ReportStringId.Msg_DontSupportMulticolumn:return "详细报表不支持多字段。";                 case ReportStringId.Msg_FileCorrupted:return "不能加载报表,文件可能被破坏或者报表组件丢失。";                  case ReportStringId.Msg_FileNotFound:return "文件没有找到";                 case ReportStringId.Msg_FillDataError:return "数据加载时发生错误。错误为:";                 case ReportStringId.Msg_IncorrectArgument:return "参数值输入不正确";                 case ReportStringId.Msg_IncorrectBandType:return "无效的带型";                 case ReportStringId.Msg_InvalidBarcodeText:return "在文本中有无效的字符";                 case ReportStringId.Msg_InvalidBarcodeTextFormat:return "无效的文本格式";                 case ReportStringId.Msg_InvalidMethodCall:return "对象的当前状态下不能调用此方法";                 case ReportStringId.Msg_InvalidReportSource:return "无法设置原报表";                 case ReportStringId.Msg_InvPropName:return "无效的属性名";                 case ReportStringId.Msg_ScriptError:return "在脚本中发现错误: {0}";                 case ReportStringId.Msg_ScriptExecutionError:return "在脚本执行过程中发现错误 {0}:  {1} 过程 {0} 被运行,将不能再被调用。";                 case ReportStringId.Msg_WrongReportClassName:return "一个错误发生在并行化期间 - 可能是报表类名错误";                 case ReportStringId.MultiColumnDesignMsg1:return "重复列之间的空位";                 case ReportStringId.MultiColumnDesignMsg2:return "控件位置不正确,将会导致打印错误";                 case ReportStringId.PanelDesignMsg:return "在此可放置不同控件";                 case ReportStringId.RepTabCtl_Designer:return "设计";                 case ReportStringId.RepTabCtl_HtmlView:return "HTML视图";                 case ReportStringId.RepTabCtl_Preview:return "预览";                 case ReportStringId.SSForm_Btn_Close:return "关闭";                 case ReportStringId.SSForm_Caption:return "式样单编辑";                 case ReportStringId.SSForm_Msg_FileFilter:return "Report StyleSheet files (*.repss)|*.repss|All files (*.*)|*.*";                 case ReportStringId.SSForm_Msg_InvalidFileFormat:return "无效的文件格式";                 case ReportStringId.SSForm_Msg_MoreThanOneStyle:return "你选择了多过一个以上的式样";                 case ReportStringId.SSForm_Msg_NoStyleSelected:return "没有式样被选中";                 case ReportStringId.SSForm_Msg_SelectedStylesText:return "被选中的式样";                 case ReportStringId.SSForm_Msg_StyleNamePreviewPostfix:return "式样";                 case ReportStringId.SSForm_Msg_StyleSheetError:return "StyleSheet错误";                 case ReportStringId.SSForm_TTip_AddStyle:return "添加式样";                 case ReportStringId.SSForm_TTip_ClearStyles:return "清除式样";                 case ReportStringId.SSForm_TTip_LoadStyles:return "从文件中读入式样";                 case ReportStringId.SSForm_TTip_PurgeStyles:return "清除式样";                  case ReportStringId.SSForm_TTip_RemoveStyle:return "移除式样";                 case ReportStringId.SSForm_TTip_SaveStyles:return "保存式样到文件";                 case ReportStringId.UD_FormCaption:return "XtraReport设计";                 case ReportStringId.UD_Msg_ReportChanged:return "报表内容已被修改,是否须要储存?";                 case ReportStringId.UD_ReportDesigner:return "XtraReport设计";                 case ReportStringId.UD_TTip_AlignBottom:return "对齐主控项的下缘";                 case ReportStringId.UD_TTip_AlignHorizontalCenters:return "对齐主控项的垂直中间";                 case ReportStringId.UD_TTip_AlignLeft:return "对齐主控项的左缘";                 case ReportStringId.UD_TTip_AlignRight:return "对齐主控项的右缘";                 case ReportStringId.UD_TTip_AlignToGrid:return "对齐网格线";                 case ReportStringId.UD_TTip_AlignTop:return "对齐主控项的上缘";                 case ReportStringId.UD_TTip_AlignVerticalCenters:return "对齐主控项的水平中央";                 case ReportStringId.UD_TTip_BringToFront:return "移到最上层";                 case ReportStringId.UD_TTip_CenterHorizontally:return "水平置中";                 case ReportStringId.UD_TTip_CenterVertically:return "垂直置中";                 case ReportStringId.UD_TTip_EditCopy:return "复制";                 case ReportStringId.UD_TTip_EditCut:return "剪贴";                 case ReportStringId.UD_TTip_EditPaste:return "粘贴";                 case ReportStringId.UD_TTip_FileOpen:return "打开文件";                 case ReportStringId.UD_TTip_FileSave:return "保存文件";                 case ReportStringId.UD_TTip_FormatAlignLeft:return "左对齐";                 case ReportStringId.UD_TTip_FormatAlignRight:return "右对齐";                 case ReportStringId.UD_TTip_FormatBackColor:return "背景颜色";                 case ReportStringId.UD_TTip_FormatBold:return "粗体";                 case ReportStringId.UD_TTip_FormatCenter:return "居中";                 case ReportStringId.UD_TTip_FormatFontName:return "字体";                 case ReportStringId.UD_TTip_FormatFontSize:return "大小";                 case ReportStringId.UD_TTip_FormatForeColor:return "前景颜色";                 case ReportStringId.UD_TTip_FormatItalic:return "斜体";                 case ReportStringId.UD_TTip_FormatJustify:return "两端对齐";                 case ReportStringId.UD_TTip_FormatUnderline:return "下划线";                             case ReportStringId.UD_TTip_HorizSpaceConcatenate:return "移除水平间距";                 case ReportStringId.UD_TTip_HorizSpaceDecrease:return "减少水平间距";                 case ReportStringId.UD_TTip_HorizSpaceIncrease:return "增加水平间距";                  case ReportStringId.UD_TTip_HorizSpaceMakeEqual:return "将垂直间距设为相等";                 case ReportStringId.UD_TTip_Redo:return "恢复";                 case ReportStringId.UD_TTip_SendToBack:return "移到最下层";                 case ReportStringId.UD_TTip_SizeToControl:return "设置成相同大小";                 case ReportStringId.UD_TTip_SizeToControlHeight:return "设置成相同高度";                 case ReportStringId.UD_TTip_SizeToControlWidth:return "设置成相同宽度";                 case ReportStringId.UD_TTip_SizeToGrid:return "依网格线调整大小";                 case ReportStringId.UD_TTip_Undo:return "撤消";                 case ReportStringId.UD_TTip_VertSpaceConcatenate:return "移除垂直间距";                 case ReportStringId.UD_TTip_VertSpaceDecrease:return "减少垂直间距";                 case ReportStringId.UD_TTip_VertSpaceIncrease:return "增加垂直间距";                 case ReportStringId.UD_TTip_VertSpaceMakeEqual:return "将垂直间距设为相等";                      }             return base.GetLocalizedString(id);         }     }          public class XtraTreeList_CN :TreeListLocalizer     {         public override string Language         {             get             {                 return "简体中文";             }         }         public override string GetLocalizedString(TreeListStringId id)         {             switch(id)             {                 case TreeListStringId.ColumnCustomizationText:return "自定显示字段";                 case TreeListStringId.ColumnNamePrefix:return "列名首标";                 case TreeListStringId.InvalidNodeExceptionText:return "是否确定要修改?";                  case TreeListStringId.MenuColumnBestFit:return "最佳匹配";                 case TreeListStringId.MenuColumnBestFitAllColumns:return "最佳匹配(所有列)";                 case TreeListStringId.MenuColumnColumnCustomization:return "列选择";                 case TreeListStringId.MenuColumnSortAscending:return "升序排序";                 case TreeListStringId.MenuColumnSortDescending:return "降序排序";                 case TreeListStringId.MenuFooterAllNodes:return "全部节点";                 case TreeListStringId.MenuFooterAverage:return "平均";                 case TreeListStringId.MenuFooterAverageFormat:return "平均值={0:#.##}";                 case TreeListStringId.MenuFooterCount:return "计数";                 case TreeListStringId.MenuFooterCountFormat:return "{0}";                 case TreeListStringId.MenuFooterMax:return "最大值";                 case TreeListStringId.MenuFooterMaxFormat:return "最大值={0}";                 case TreeListStringId.MenuFooterMin:return "最小值";                 case TreeListStringId.MenuFooterMinFormat:return "最小值={0}";                 case TreeListStringId.MenuFooterNone:return "无";                 case TreeListStringId.MenuFooterSum:return "合计";                 case TreeListStringId.MenuFooterSumFormat:return "合计={0:#.##}";                 case TreeListStringId.MultiSelectMethodNotSupported:return "OptionsBehavior.MultiSelect未激活时,指定方法不能工作.";                 case TreeListStringId.PrintDesignerDescription:return "为当前的树状列表设置不同的打印选项.";                 case TreeListStringId.PrintDesignerHeader:return "打印设置";             }             return base.GetLocalizedString(id);         }     }          public class XtraVerticalGrid_CN :VGridLocalizer     {         public override string Language         {             get             {                 return "简体中文";             }         }         public override string GetLocalizedString(VGridStringId id)         {             switch(id)             {                 case VGridStringId.InvalidRecordExceptionText:return "是否确定修改?";                 case VGridStringId.RowCustomizationDeleteCategoryText:return "删除";                 case VGridStringId.RowCustomizationNewCategoryFormLabelText:return "标题";                 case VGridStringId.RowCustomizationNewCategoryFormText:return "新增类别";                 case VGridStringId.RowCustomizationNewCategoryText:return "新增";                 case VGridStringId.RowCustomizationTabPageCategoriesText:return "类别";                 case VGridStringId.RowCustomizationTabPageRowsText:return "行";                 case VGridStringId.RowCustomizationText:return "自定义";                 case VGridStringId.StyleCreatorName:return "自定义式样";             }             return base.GetLocalizedString(id);         }     }

下载文档到电脑,查找使用更方便

文档的实际排版效果,会与网站的显示效果略有不同!!

需要 10 金币 [ 分享文档获得金币 ] 0 人已下载

下载文档