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

折腾了好久,总是发现在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(00);
            
this.gridControl1.MainView = this.gridView1;
            
this.gridControl1.Name = "gridControl1";
            
this.gridControl1.Size = new System.Drawing.Size(654526);
            
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(654526);
            
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);

        }



 


    

posted on 2006-05-03 09:59  c#之旅  阅读(5237)  评论(7编辑  收藏  举报

导航