Dxexpress 的GridControl控件中一次选择一行并且不显示单元格焦点的设置

翻译|其它|编辑:郝浩|2007-09-12 09:08:18.000|阅读 3107 次

概述:折腾了好久,总是发现在 gridView 中一选择的话,选择一行是没有问题,但被点中的单元格却失去了高亮度显示的特征,此时发现行标记那里有一个指示可以编辑的符号,测试了一下,但把此可编辑符号搞掉以后,就能实现一次选择完整的一行.

# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>

折腾了好久,总是发现在  gridView  中一选择的话,选择一行是没有问题,但被点中的单元格却失去了高亮度显示的特征,此时发现行标记那里有一个指示可以编辑的符号,测试了一下,但把此可编辑符号搞掉以后,就能实现一次选择完整的一行.

一般这样设置就可以了.

private void InitializeComponent()
        
...{
            
this.components = new System.ComponentModel.Container();
            
this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components);
            
this.gridControl1 = new DevExpress.XtraGrid.GridControl();
            
this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
            ((System.ComponentModel.ISupportInitialize)(
this.bindingSource1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(
this.gridControl1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(
this.gridView1)).BeginInit();
            
this.SuspendLayout();
            
// 
            // bindingSource1
            // 

            this.bindingSource1.CurrentChanged += new System.EventHandler(this.bindingSource1_CurrentChanged_1);
            
// 
            // gridControl1
            // 

            this.gridControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            
// 
            // 
            // 

            this.gridControl1.EmbeddedNavigator.Name = "";
            
this.gridControl1.Location = new System.Drawing.Point(0, 0);
            
this.gridControl1.MainView = this.gridView1;
            
this.gridControl1.Name = "gridControl1";
            
this.gridControl1.Size = new System.Drawing.Size(654, 526);
            
this.gridControl1.TabIndex = 0;
            
this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] ...{
            
this.gridView1});
            
// 
            // gridView1
            // 
           
            // 

            this.gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            
this.gridView1.GridControl = this.gridControl1;
            
this.gridView1.Name = "gridView1";
            
this.gridView1.OptionsBehavior.Editable = false;
            
this.gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
            
            
// 
            // 
            // Form1
            // 

            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            
this.ClientSize = new System.Drawing.Size(654, 526);
            
this.Controls.Add(this.gridControl1);
            
this.Name = "Form1";
            
this.Text = "Form1";
            
this.Load += new System.EventHandler(this.Form1_Load);
            ((System.ComponentModel.ISupportInitialize)(
this.bindingSource1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(
this.gridControl1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(
this.gridView1)).EndInit();
            
this.ResumeLayout(false);
        }


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com

文章转载自:csdn

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP