1.GridControl隐藏GroupPanel(主面板)

隐藏:鼠标单击Run Designer-OptionsView-ShowGroupPanel=False;

修改:鼠标单击Run Designer-Appearance-GroupPanelText="检索信息";

this.gridView1.OptionsView.ShowGroupPanel = false;//隐藏

this.gridView1.GroupPanelText = "检索信息";

2.GridControl禁用标题列右键菜单

鼠标单击Run Designer-OptionsMenu-EnableColumnMenu=False;

this.gridView1.OptionsMenu.EnableColumnMenu = false;//后台代码实现

3.GridControl隐藏标题列信息

鼠标单击Run Designer-OptionsView-ShowColumnHeaders=False;

this.gridView1.OptionsView.ShowColumnHeaders = false;//后台代码实现

4.GridControl显示最左边的空白列并且设置它的宽度,把生成的序号在这个空白列中显示出来

显示左边空白列:鼠标单击Run Designer-OptionsView-ShowIndicator=True;

设置宽度:鼠标单击Run Designer-Appearance-IndicatorWidth=50;

this.gridView1.OptionsView.ShowIndicator = true;// 显示最左边空白列
this.gridView1.IndicatorWidth = 50;//设置最左边空白列的宽度 //启用事件生成序号
this.gridView1.CustomDrawRowIndicator += new DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventHandler(this.gridView1_CustomDrawRowIndicator); #region 生成序号
private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.Kind == DevExpress.Utils.Drawing.IndicatorKind.Header)
{
e.Info.DisplayText = "行号";//设置列名称
}
e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;//设置列居中显示
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
{
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
}
#endregion

5.GridControl取消点击后的虚线框

修改:鼠标单击Run Designer-Appearance-FocusRectStyle=None;

this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.None;

6.GridControl禁用列宽自适应(总宽度超出桌面宽度显示水平滚动条)

鼠标单击Run Designer-OptionsView-ColumnAutoWidth=False;

this.gridView1.OptionsView.ColumnAutoWidth = false; 

7.GridControl禁用标题列过滤

鼠标单击Run Designer-OptionsCustomization-AllowFilter=False;

this.gridView1.OptionsCustomization.AllowFilter = false;

8.GridControl禁用标题列排序(点击标题列升序(降序))

鼠标单击Run Designer-OptionsCustomization-AllowSort=False;

 this.gridView1.OptionsCustomization.AllowSort = false;

9.GridControll禁用标题列移动(拖动列改变列的位置)

鼠标单击Run Designer-OptionsCustomization-AllowColumnMoving=False;

this.gridView1.OptionsCustomization.AllowColumnMoving = false;

10.GridControll禁用标题列改变宽度(拖动列改变列的宽度)

鼠标点击Run Designer-OptionsCustomization-AllowColumnResizing=False;

this.gridView1.OptionsCustomization.AllowColumnResizing = false;

11.GridControll禁用标题列分组

鼠标单击Run Designer-OptionsCustomization-AllowGroup=False;

this.gridView1.OptionsCustomization.AllowGroup = false;

12.GridControll是否显示过滤面板

鼠标单击Run Designer-OptionsCustomization-AllowGroup=False;

this.gridView1.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never;

13.GridControll设置奇数行颜色为红色

设置奇数行改变颜色:置鼠标点击Run Designer-OptionsView-EnableAppearanceOddRow=True;

设置奇数行的颜色:鼠标点击Run Designer-Appearance-OddRow-BackColor=System.Drawing.Color.Red;

this.gridView1.OptionsView.EnableAppearanceOddRow = true;//奇数行颜色变化
this.gridView1.Appearance.OddRow.BackColor = System.Drawing.Color.Red;//奇数行颜色设置

14.GridControll设置偶数行颜色为蓝色

设置偶数行改变颜色:置鼠标点击Run Designer-OptionsView-EnableAppearanceEvenRow=True;

设置偶数行的颜色:鼠标点击Run Designer-Appearance-EvenRow-BackColor=System.Drawing.Color.Blue;

this.gridView1.OptionsView.EnableAppearanceEvenRow = true;//偶数行颜色变化
this.gridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.Blue;//偶数行颜色设置

15.GridControll设置列中的数据只读

设置编辑:鼠标单击Run Designer-OptionsBehavior-Editable=False;

this.gridView1.OptionsBehavior.Editable = false;

16.GridControll设置只能选择行并且数据不能编辑

设置只能选中整行:鼠标单击Run Designer-OptionsBehavior-EditorShowMode=DevExpress.Utils.EditorShowMode.Click;

设置列的数据不能编辑:鼠标单击Run Designer-OptionsBehavior-Editable=False;

this.gridView1.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;//设置只能选中整行
this.gridView1.OptionsBehavior.Editable = false;//设置列的数据不能编辑

17.GridControll设置列中的数据只读并且不可拷贝

设置数据可编辑:鼠标单击Run Designer-OptionsBehavior-Editable=True;

设置数据只读并且不可拷贝:鼠标单击Run Designer-OptionsBehavior-ReadOnly=True;

gridView1.OptionsBehavior.Editable = true;//设置列能编辑
gridView1.OptionsBehavior.ReadOnly = true;//设置设置只读并且不可拷贝

18.GridControll设置指定列中的数据只读不可拷贝

设置列能编辑: 鼠标单击Run Designer-OptionsBehavior-Editable=False;

设置单元格能编辑: 鼠标单击Run Designer-Columns- 列名称-OptionsColumn-AllowEdit=True;

设置单元格只读并且不能拷贝: 鼠标单击Run Designer-Columns- 列名称-OptionsColumn-ReadOnly=True;

gridView1.OptionsBehavior.Editable = true;//设置列能编辑
列名称.OptionsColumn.AllowEdit = true;// 设置单元格能编辑 默认:true
列名称.OptionsColumn.ReadOnly = true;//设置单元格只读并且不能拷贝 默认:false

19.GridControll设置只能选中整行并且列中的数据不能编辑并且选中列的颜色跟着改变

设置只能选中整行:鼠标单击Run Designer-OptionsBehavior-EditorShowMode=DevExpress.Utils.EditorShowMode.Click;

设置列的数据不能编辑:鼠标单击Run Designer-OptionsBehavior-Editable=False;

设置选中列的颜色跟着改变:鼠标单击Run Designer-OptionsSelection-EnableAppearanceFocusedCell=True;

this.gridView1.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.Click;//设置只能选中整行
this.gridView1.OptionsBehavior.Editable = false;//设置列的数据不能编辑
this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;//选中列的颜色跟着改变

20.GridControll禁用自动填充列

鼠标单击Run Designer-OptionsBehavior-AutoPopulateColumns=False;

this.gridView1.OptionsBehavior.AutoPopulateColumns = false;

21.GridControll选中整行

鼠标单击Run Designer-OptionsSelection-EnableAppearanceFocusedRow=True;

this.gridView1.OptionsSelection.EnableAppearanceFocusedRow = true;

22.GridControll启用列的多选,列的选择方式(CellSelect:多选单元格 CheckBoxRowSelect:复选框 RowSelect:多选行)

启用列的多选:鼠标单击Run Designer-OptionsSelection-MultiSelect=True;

设置列为复选框多选:鼠标单击Run Designer-OptionsSelection-MultiSelectMode=DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;

this.gridView1.OptionsSelection.MultiSelect = true;
this.gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;

注:选中事件:SelectionChanged()、focusedRowChanged(),当选择的模式是单行时,须使用focusedRowChanged()

23.GridControll设置标题列居中

鼠标单击Run Designer-Appearance-HeaderPanel-TextOptions-HAlignment=DevExpress.Utils.HorzAlignment.Center;

this.gridView1.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

24.GridControll不使用TAB/SHIFT+TAB移动焦点

鼠标单击Run Designer-OptionsNavigation-UseTabKey=True;

gridView1.OptionsNavigation.UseTabKey = true;

25.GridControll显示合计

鼠标单击Run Designer-OptionsView-ShowFooter=True;

设置指定列的合计:Run Designer-Columns-选择列名称-SummaryItem-SummaryType=Sum;

this.gridView1.OptionsView.ShowFooter = true;

//动态创建GridColumn列的时候设置
#region 第一种方式
//age:列名称
age.SummaryItem.DisplayFormat = "{0:f2}";//设置显示格式
age.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;//汇总方式
#endregion
#region 第二种方式
//age:列名称 DevExpress.Data.SummaryItemType.Sum:汇总方式 {0:n2}:显示格式
age.Summary.AddRange(new DevExpress.XtraGrid.GridSummaryItem[] {
new DevExpress.XtraGrid.GridColumnSummaryItem(DevExpress.Data.SummaryItemType.Sum, "age", "{0:n2}")});
#endregion

26.GridControll设置列中的数据自动换行

鼠标单击Run Designer-OptionsView-RowAutoHeight=True;

给指定列设置控件:Run Designer-Columns-选择列名称-ColumnEdit选择“MemoEdit”;

this.gridView1.OptionsView.RowAutoHeight = true;//设置自动换行

#region 创建一个文本控件
DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit memoEdit = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
memoEdit.AutoHeight = false;
memoEdit.Name = "memoEdit";
#endregion school.ColumnEdit = memoEdit;//school:表示列 在创建GridColumn列的时候设置ColumnEdit的值

27.GridControll设置相同列合并

鼠标单击Run Designer-OptionsView-AllowCellMerge=True;

this.gridView1.OptionsView.AllowCellMerge = true;//启用合并列

// 启用指定合并列事件
this.gridView1.CellMerge += new DevExpress.XtraGrid.Views.Grid.CellMergeEventHandler(gridView1_CellMerge); #region 合并指定的列
private void gridView1_CellMerge(object sender, DevExpress.XtraGrid.Views.Grid.CellMergeEventArgs e)
{
int rowHandle1 = e.RowHandle1;//合并列的第一行
int rowHandle2 = e.RowHandle2;//合并列从1开始到最后行就是
string strValue1 = this.gridView1.GetListSourceRowCellValue(rowHandle1, "age").ToString();//age:列名称
string strValue2 = this.gridView1.GetListSourceRowCellValue(rowHandle2, "age").ToString();//age:列名称
if (strValue1 != strValue2)
{
e.Merge = false; //值相同的2个单元格是否要合并在一起
e.Handled = true; //合并单元格是否已经处理过,无需再次进行省缺处理
}
}
#endregion

28.GridControll显示自带的 搜索功能

鼠标单击Run Designer-OptionsFind-AlwaysVisible=True;

this.gridView1.OptionsFind.AlwaysVisible = true;

29.GridControll控件绑定数据源

gridControl1.DataSource = dt;//dt 数据源可以是DataTable也可以是List集合

30.GridControll控件没有绑定数据源或者查询出来的数据为0条记录时显示自定义的提示语句

//启用事件
this.gridView1.CustomDrawEmptyForeground += new DevExpress.XtraGrid.Views.Base.CustomDrawEventHandler(this.gridView1_CustomDrawEmptyForeground); //具体实现的提示语句
private void gridView1_CustomDrawEmptyForeground(object sender, DevExpress.XtraGrid.Views.Base.CustomDrawEventArgs e)
{
DevExpress.XtraGrid.Views.Base.ColumnView columnView = sender as DevExpress.XtraGrid.Views.Base.ColumnView;
BindingSource bindingSource = this.gridView1.DataSource as BindingSource;
if (bindingSource == null || bindingSource.Count == 0)
{
string str = "没有查询到你所想要的数据!";
Font f = new Font("宋体", 10, FontStyle.Bold);
Rectangle r = new Rectangle(e.Bounds.Top + 105, e.Bounds.Left + 5, e.Bounds.Right - 5, e.Bounds.Height - 5);
e.Graphics.DrawString(str, f, Brushes.Black, r);
}
}

31.GridControll添加新行

新增行: gridView1.AddNewRow();

实现 gridView_InitNewRow 事件(对于新加行的特别的设置)

//启用事件
this.gridView1.InitNewRow += new DevExpress.XtraGrid.Views.Grid.InitNewRowEventHandler(gridView1_InitNewRow); //添加行按钮事件
private void btn_addRow_Click(object sender, EventArgs e)
{
//注:在添加行的时候必须先给“gridControl1.DataSource”绑定数据源不然添加会没有任何反映
gridView1.AddNewRow();
}
//新增行
private void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
{
#region 根据列名添加数据:“name”列名称-值 “王大”
//DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
//view.SetRowCellValue(e.RowHandle, view.Columns["name"], "王大");
//view.SetRowCellValue(e.RowHandle, view.Columns["age"], "20");
#endregion
#region 复制最后一行
DevExpress.XtraGrid.Views.Base.ColumnView View = sender as DevExpress.XtraGrid.Views.Base.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])); //复制最后一行的数据到新行
#endregion
#region 只添加一行,没有如何数据
//Application.DoEvents();
//try
//{
// this.gridView1.BeginInit();
// this.gridControl1.Focus();//获取光标
// this.gridView1.Focus();//获取光标
// this.gridView1.SelectCell(e.RowHandle, this.gridView1.Columns["列名称"]);//选中列
// this.gridView1.FocusedColumn = this.gridView1.Columns["列名称"];//设置焦点行的焦点单元格的位置
// this.gridView1.ShowEditor();//设置编辑状态的列
//}
//finally
//{
// this.gridView1.EndInit();
//}
#endregion
}

32.GridControll删除行

gridView1.DeleteSelectedRows();

33.GridControll定位到某行

//第一行
this.gridView1.MoveFirst(); //下一行
this.gridView1.MoveNext(); //最后一行
this.gridView1.MoveLast();

33.GridControll指定列内容显示居中

启用列的文本选项: 鼠标单击Run Designer-Columns- 列名称-Appearance-AppearanceCell-Options-UseTextOptions=True;

设置列的文本居中: 鼠标单击Run Designer-Columns- 列名称-Appearance-AppearanceCell-TextOptions-HAlignment=Center;

列名称.AppearanceCell.Options.UseTextOptions = true;
列名称.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

34.GridControll去掉指定列上的自动筛选功能

鼠标单击Run Designer-Columns- 列名称-Options-OptionsFilter-AllowAutoFilter=False;

鼠标单击Run Designer-Columns- 列名称-Options-OptionsFilter-AllowFilter=False;

鼠标单击Run Designer-Columns- 列名称-Options-OptionsFilter-ImmediateUpdateAutoFilter=False;

列名称.OptionsFilter.AllowAutoFilter = false;
列名称.OptionsFilter.AllowFilter = false;
列名称.OptionsFilter.ImmediateUpdateAutoFilter = false;

35.GridControll设置指定列左固定(冻结在左边)

列名称.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;

36.GridControll获取指定列中的数据

string texts = gridView1.GetRowCellDisplayText(1, gridView1.Columns[3]);//获取第一行四列中的数据
string values = gridView1.GetRowCellValue(2, gridView1.Columns["列名称"]).ToString();//获取第二行指定列的数据

37.GridControll设置单元格数据(将0行4列的单元格赋值111)

gridView1.SetRowCellValue(0, gridView1.Columns[3], "111");//0:行号 gridView1.Columns[3]:列  111:赋值内容

38.GridControll设置获取焦点

//设置自定义行的焦点
this.gridView1.FocusedRowHandle = 3; //获取焦点行的下标
int lineNumber = this.gridView1.FocusedRowHandle;
//获取焦点行的下标
DevExpress.XtraGrid.Views.Base.ColumnView newview = (DevExpress.XtraGrid.Views.Base.ColumnView)gridControl1.FocusedView;
lineNumber = newview.FocusedRowHandle; //根据列名称获取焦点行中任意单元格的值
DevExpress.XtraGrid.Views.Base.ColumnView cv = (DevExpress.XtraGrid.Views.Base.ColumnView)gridControl1.FocusedView;
int focusedhandle = cv.FocusedRowHandle;
object rowIdObj = gridView1.GetRowCellValue(focusedhandle, "age");//“age”表示:列名称
if (DBNull.Value != rowIdObj)
{
int age = Convert.ToInt32(rowIdObj);
} //根据列名称设置焦点行的焦点单元格
DevExpress.XtraGrid.Views.Base.ColumnView view = (DevExpress.XtraGrid.Views.Base.ColumnView)gridControl1.FocusedView;
view.FocusedColumn = view.Columns["classs"];//“classs”表示:列名称

39.GridControll自定义绘制表格颜色

//启用事件
this.gridView1.CustomDrawCell += new DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventHandler(this.gridView1_CustomDrawCell); private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
{
if (e.Column.FieldName.Equals("age"))//列名称
{
DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo cellInfo = e.Cell as DevExpress.XtraGrid.Views.Grid.ViewInfo.GridCellInfo;
if (cellInfo.IsDataCell)
{
if (double.Parse(cellInfo.CellValue.ToString()) < 20)//年龄小于20
{
e.Appearance.BackColor = Color.OrangeRed;
}
else if (double.Parse(cellInfo.CellValue.ToString()) < 100)//年龄小于100
{
e.Appearance.BackColor = Color.YellowGreen;
}
else
{
e.Appearance.BackColor = Color.Gold;
}
}
}
}

40.GridControll根据动态条件自动义绘制指定行的颜色

 //启用事件
this.gridView1.RowStyle += new DevExpress.XtraGrid.Views.Grid.RowStyleEventHandler(this.gridView1_RowStyle); private void gridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
DevExpress.XtraGrid.Views.Grid.GridView View = sender as GridView;
if (e.RowHandle >= 0)
{
object needAlert = View.GetRowCellValue(e.RowHandle, View.Columns["age"]);
if (needAlert != null & needAlert != DBNull.Value && needAlert.ToString().Trim() != "0" )
{
decimal AverValue = Convert.ToDecimal(View.GetRowCellValue(e.RowHandle, View.Columns["age"]));
if ( AverValue > 50)
{
e.Appearance.ForeColor = Color.Red;
e.Appearance.BackColor = Color.LightGray;
}
}
}
}

41.GridControll自定义列显示文本

//启用事件
this.gridView1.CustomColumnDisplayText += new DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventHandler(this.gridView1_CustomColumnDisplayText); private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
if (e.Value != null && e.Value.ToString().Length > 0)
{
if (e.Column.FieldName == "gender")
{
e.DisplayText = e.Value.ToString().Trim()=="1"?"男":"女";
}
}
}

41.动态创建列并且设置一些基本的列属性

//创建DataTable赋值并给gridControl指定数据源
private void CreateData()
{
DataTable dt = new DataTable();
dt.Columns.Add("name", Type.GetType("System.String"));
dt.Columns.Add("age", Type.GetType("System.String"));
dt.Columns.Add("gender", Type.GetType("System.String"));
dt.Columns.Add("school", Type.GetType("System.String"));
dt.Columns.Add("classs", Type.GetType("System.String"));
for (int i = 0; i < 5; i++)
{
DataRow row = dt.NewRow();
row["name"] = "张三" + i;
if (i == 0 || i == 1)
row["age"] = "18";
else
row["age"] = "18" + i;
row["gender"] = "1";
row["school"] = "理工大学理工大学理工大学理工大学理工大学理工大学理工大学理工大学理工大学理工大学理工大学理工大学" + i;
row["classs"] = "天才2021级" + i;
dt.Rows.InsertAt(row, i);
}
gridControl1.DataSource = dt;//表格获取数据源
} //创建列、表格中控件的创建和列的一些属性设置
private void CreateColumn()
{
#region 创建一个文本控件
DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit memoEdit = new DevExpress.XtraEditors.Repository.RepositoryItemMemoEdit();
memoEdit.AutoHeight = false;
memoEdit.Name = "memoEdit";
#endregion

#region 设置列的属性
GridColumn name = new GridColumn();
name.Caption = " 姓名";//显示名称
name.FieldName = "name";//数据源名称
name.Width = 50;//宽度
name.Visible = true;//是否显示
name.OptionsColumn.AllowEdit = true;// 单元格能编辑
name.OptionsColumn.ReadOnly = false;//设置只读
name.Fixed = DevExpress.XtraGrid.Columns.FixedStyle.Left;//把本列固定在左边
this.gridView1.Columns.Add(name);//给指定的“GridBand”("基本信息")添加列 GridColumn age = new GridColumn();
age.Caption = "年龄";
age.FieldName = "age";
age.Width = 45;
age.Visible = true;
age.AppearanceCell.Options.UseTextOptions = true;
age.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
age.SummaryItem.DisplayFormat = "{0:f2}";//设置显示格式
age.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;//汇总方式
this.gridView1.Columns.Add(age); GridColumn gender = new GridColumn();
gender.Caption = "性别";
gender.AppearanceCell.Options.UseTextOptions = true;//启动设置文本显示
gender.AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;//设置文本居中
gender.OptionsFilter.AllowAutoFilter = false;//设置列不能筛选
gender.OptionsFilter.AllowFilter = false;//设置列不能筛选
gender.OptionsFilter.ImmediateUpdateAutoFilter = false;//设置列不能筛选
gender.FieldName = "gender";
gender.MinWidth = 45;
gender.Visible = true;
this.gridView1.Columns.Add(gender); GridColumn school = new GridColumn();
school.Caption = "学校";
school.FieldName = "school";
school.ColumnEdit = memoEdit;
school.MinWidth = 100;
school.Visible = true;
this.gridView1.Columns.Add(school); GridColumn classs = new GridColumn();
classs.Caption = "班级";
classs.FieldName = "classs";
classs.MinWidth = 80;
classs.Visible = true;
this.gridView1.Columns.Add(classs);
#endregion
}

搜索

复制

C# DevExpress中GridControl控件的基本属性设置和使用方法的更多相关文章

  1. DevExpress中GridControl控件焦点改变时触发事件

    FocusedRowObjectChanged 事件.可以在焦点改变一行的时候触发对应的事件. 做一个记录 大家如果有问题可以 Console.WriteLine("加群"+&qu ...

  2. DevExpress的GridControl控件更新數據問題解決辦法

    開發WPF程序時,使用Devexpress的GridControl控件用ItemSource綁定數據,在頁面進行編輯時,當屬性繼承INotifyPropertyChanged接口時會同步更新後臺數據. ...

  3. DevExpress之GridControl控件小知识

    DevExpress之GridControl控件小知识 一.当代码中的DataTable中有建数据关系时,DevExpress 的 GridControl 会自动增加一个子视图 .列名也就是子表的字段 ...

  4. 玩转控件:对Dev中GridControl控件的封装和扩展

    又是一年清明节至,细雨绵绵犹如泪光,树叶随风摆动.... 转眼间,一年又过去了三分之一,疫情的严峻让不少企业就跟清明时节的树叶一样,摇摇欲坠.裁员的裁员,降薪的降薪,996的996~~说起来都是泪,以 ...

  5. 玩转控件:重绘DEVEXPRESS中DateEdit控件 —— 让DateEdit支持只选择年月 (提供源码下载)

      前言 上一篇博文<玩转控件:重绘ComboBox —— 让ComboBox多列显示>中,根据大家的回馈,ComboBox已经支持筛选了,更新见博文最后最后最后面.   奇葩 这两天遇到 ...

  6. 关于Devexpress15.2中GridControl控件选择字段ColumnEdit下拉时间设置

    效果:点击表格GridControl控件中的列,可以显示日期和时间.时间可以手动修改.(绑定日期格式的字段) 设置步骤:1.点击时间字段列表设置ColumnEdit-New-选择DateEdit出现r ...

  7. DevExpress中 TreeList控件的常规配置

    //以下为TreeList控件样式相关设置 this.treelist_SystemCfg.BackColor = Color.Transparent; this.treelist_SystemCfg ...

  8. devexpress中gridview控件编辑时改变输入法状态

    在win7环境下使用Devexpress中的SpinEdit控件,切换成中文[简/繁]输入法输入数字键时有不少输入法会重复产生数字如输入1会变成11,输入123会变成112233.使用SpinEdit ...

  9. Devexpress中WebChartControl控件柱状统计图的做法(数据为调用存储过程)

    //前台控件代码:WebChartControl控件: <%-- 月采购量统计--%> <dxchartsui:WebChartControl ID="WebChartCo ...

  10. DevExpress的GridControl控件设置自定义显示方法

    比如要显示性别为字符串,数据库中保存为数值(1:男,2:女,3:未知). 方法一: 点击控件上的"Run Designer"按钮,进入设计界面. 选择“Columns", ...

随机推荐

  1. 学 Rust 要几天?「GitHub 热点速览 v.22.51」

    本周的 GitHub Trending 非常给力,一是解决了 Rust 的学习问题,提供了一个全面的教学课程:二是提供了多个高性能工具,比如,为 PWA 而生的 atrilabs-engine,部署方 ...

  2. S2-017 CVE-2013-2248

    漏洞名称 Apache Struts 多个开放重定向漏洞 (CVE-2013-2248) s2-017 利用条件 Struts 2.0.0 - Struts 2.3.15 漏洞原理 通过操作前缀为&q ...

  3. [Leetcode]扁平化多级双向链表

    题目   https://leetcode-cn.com/explore/learn/card/linked-list/197/conclusion/764/ 代码 /* // Definition ...

  4. 深入理解C++虚函数底层机制和RTTI运行时类型识别

    当调用一个虚函数时,被执行的代码必须与调用函数对象的动态类型相一致:指向对象的指针或引用的类型是不重要的,编译器是如何高效地提供这种行为呢?大多数编译器是使用virtual table和virtual ...

  5. centos搭建neo4j环境(含java)2021_12

    限centos neo4j与java下载: 链接:https://pan.baidu.com/s/1ei15dROGy3OwJfbislxH7g 提取码:8B3A   下载后 1.在linux中建立文 ...

  6. LinkedList集合-Vector集合

    LinkedList集合 java.util.LinkedList集合数据存储的结构是链表结构.方便元素添加.删除的集合.LinkedList是一个双向链表,那么双向链表是什么样子的呢,我们用个图了解 ...

  7. 集合框架-Collection集合

    集合框架 JAVASE提供了满足各种需求的APl,在使用这些API前,先了解其继承与接口操作架构,才能了解何时采用哪个类,以及类之间如何彼此合作,从而达到灵活应用.集合按照其存储结构可以分为两大类,分 ...

  8. SQLSERVER 的四个事务隔离级别到底怎么理解?

    一:背景 1. 讲故事 在有关SQLSERVER的各种参考资料中,经常会看到如下四种事务隔离级别. READ UNCOMMITTED READ COMMITTED SERIALIZABLE REPEA ...

  9. GPIO-CH32x系列芯片GPIO使用注意事项

    一.特殊IO使用注意事项 芯片型号:CH32F203C8T6.CH32V203C8T6 特殊IO:PC13.PC14.PC15 注意事项说明: 1.PC13~PC15的IO功能受限,速度必须限制在2M ...

  10. SpringBoot 三大开发工具,你都用过么?

    本文已经收录到Github仓库,该仓库包含计算机基础.Java基础.多线程.JVM.数据库.Redis.Spring.Mybatis.SpringMVC.SpringBoot.分布式.微服务.设计模式 ...