Мы создаем приложение для Windows в Visual Studio C # 2008 Express Edition, возвращая набор данных с нашего сервера и отображая его в DataGridView.Некоторые пользователи жалуются, что вертикальная полоса прокрутки продолжает исчезать, когда они работают.Они могут восстановить его, закрыв этот экран и открыв его снова.
Мы изо всех сил пытаемся отладить эту проблему, потому что это не происходит постоянно и никогда не случается с некоторыми пользователями (включая всех наших разработчиков).
Когда полоса прокрутки исчезает, она покидает пространство, которое она занимала, но вместо отображения элемента управления мы получаем градуированный синий цвет (который в этой точке выглядит очень точно по линии экрана).
Мое первоначальное ощущение, что это может быть ошибкой в элементе управления DataGridView.Кто-нибудь из вас сталкивался с такой ошибкой раньше?Можете ли вы предложить какие-либо предложения о том, где начать это исправить?
Код, который мы запускаем: Мой коллега (который разрабатывает этот экран) предоставил вам следующий код: // // dGridJournal // this.dGridJournal.AllowUserToAddRows = false;this.dGridJournal.AllowUserToDeleteRows = false;this.dGridJournal.AllowUserToResizeRows = false;this.dGridJournal.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));this.dGridJournal.AutoGenerateColumns = false;dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;dataGridViewCellStyle1.Font = new System.Drawing.Font («Microsoft Sans Serif», 8,25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (0)));dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;this.dGridJournal.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;this.dGridJournal.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;this.dGridJournal.Columns.AddRange (new System.Windows.Forms.DataGridViewColumn [] {this.jrnhidDataGridViewTextBoxColumn, this.typedesc, this.pdateDataGridViewTextBoxColumn, this.narridDataGridTownTataTownTextBolxtTechTextTolTxt)this.dGridJournal.DataCont = this.dataContJournalEnquiries;this.dGridJournal.DataSource = this.ttJRNHeaderBindingSource;dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Window;dataGridViewCellStyle3.Font = new System.Drawing.Font («Microsoft Sans Serif», 8,25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (0)));dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False;this.dGridJournal.DefaultCellStyle = dataGridViewCellStyle3;this.dGridJournal.LabelText = "Пожалуйста, введите обязательные критерии.";this.dGridJournal.Location = new System.Drawing.Point (4, 4);this.dGridJournal.ModifiedCellColor = System.Drawing.Color.SandyBrown;this.dGridJournal.MultiSelect = false;this.dGridJournal.Name = "dGridJournal"; this.dGridJournal.ReadOnly = true; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle4.Font = new System.Drawing.Font ("Microsoft Sans Serif", 8,25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (0))); dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dGridJournal.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; this.dGridJournal.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dGridJournal.Size = new System.Drawing.Size (488, 95); this.dGridJournal.TabIndex = 1; this.dGridJournal.TabStop = false; this.dGridJournal.UpScroll = true;
this.dGridJournal.SortStarted + = new CapitaHartshead.Core.Controls.CHDataGridView.SortStartingHandler (this.dGridJournal_SortStarted); this.dGridJournal.SelectionChanged + = new System.EventHandler (this.dGridJournal_SelectionChanged); // // jrnhidDataGridViewTextBoxColumn // this.jrnhidDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; this.jrnhidDataGridViewTextBoxColumn.DataPropertyName = "jrnhid"; this.jrnhidDataGridViewTextBoxColumn.HeaderText = "Номер журнала";
this.jrnhidDataGridViewTextBoxColumn.Name = "jrnhidDataGridViewTextBoxColumn"; this.jrnhidDataGridViewTextBoxColumn.ReadOnly = true; this.jrnhidDataGridViewTextBoxColumn.Width = 97; // // typedesc // this.typedesc.DataPropertyName = "typedesc"; this.typedesc.HeaderText = "Тип"; this.typedesc.Name = "typedesc"; this.typedesc.ReadOnly = true; this.typedesc.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.typedesc.Width = 55; // // pdateDataGridViewTextBoxColumn // this.pdateDataGridViewTextBoxColumn.DataPropertyName = "pdate";
this.pdateDataGridViewTextBoxColumn.HeaderText = "Date"; this.pdateDataGridViewTextBoxColumn.Name = "pdateDataGridViewTextBoxColumn"; this.pdateDataGridViewTextBoxColumn.ReadOnly = true; this.pdateDataGridViewTextBoxColumn.Width = 80; // // narridDataGridViewTextBoxColumn // this.narridDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.narridDataGridViewTextBoxColumn.DataPropertyName = "narr"; this.narridDataGridViewTextBoxColumn.HeaderText = "Description";
this.narridDataGridViewTextBoxColumn.Name = "narridDataGridViewTextBoxColumn"; this.narridDataGridViewTextBoxColumn.ReadOnly = true; this.narridDataGridViewTextBoxColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // pvalueDataGridViewTextBoxColumn // this.pvalueDataGridViewTextBoxColumn.DataPropertyName = "pvalue"; dataGridViewCellStyle2.Format = "C2"; dataGridViewCellStyle2.NullValue = null; this.pvalueDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle2; this.pvalueDataGridViewTextBoxColumn.HeaderText = "Value";
this.pvalueDataGridViewTextBoxColumn.Name = "pvalueDataGridViewTextBoxColumn"; this.pvalueDataGridViewTextBoxColumn.ReadOnly = true; this.pvalueDataGridViewTextBoxColumn.Width = 80; // // authdesc // this.authdesc.DataPropertyName = "authdesc"; this.authdesc.HeaderText = "State"; this.authdesc.Name = "authdesc"; this.authdesc.ReadOnly = true; this.authdesc.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; this.authdesc.Width = 50;