Click here to Skip to main content
15,884,177 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionAVI library? Pin
erossetto28-Sep-04 13:51
erossetto28-Sep-04 13:51 
AnswerRe: AVI library? Pin
Tomas Petricek29-Sep-04 11:53
Tomas Petricek29-Sep-04 11:53 
GeneralRe: AVI library? Pin
erossetto2-Oct-04 18:43
erossetto2-Oct-04 18:43 
GeneralOutlook style datagrid Pin
cocotech28-Sep-04 9:40
cocotech28-Sep-04 9:40 
GeneralRe: Outlook style datagrid Pin
Al Gardner11-Oct-04 11:58
Al Gardner11-Oct-04 11:58 
GeneralIL Runtime Conformance Testing Pin
Joel_Rivendell28-Sep-04 0:33
Joel_Rivendell28-Sep-04 0:33 
GeneralRe: IL Runtime Conformance Testing Pin
leppie28-Sep-04 0:50
leppie28-Sep-04 0:50 
GeneralDataGrid refresh issue Pin
shvartsy27-Sep-04 21:43
shvartsy27-Sep-04 21:43 
I am experiencing an interesting behaviour with the DataGrid in .NET Framework 1.1 SP1. The problem cannot be reproduced in non-SP1 environment. If you select a read-only grid cell and refresh the grid with new data, the cell that was selected overlays the new data in the grid, as if the EndEdit has not been called.
Below is the sample code. I’d appreciate any comments, is it a bug in SP1, or it is me doing something stupid?

// Populate the grid, click on the cell, then click the Refresh button. The old cell value is still visible.

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace GridTest
{
///
/// Summary description for Form1.
///

public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button btnRefresh;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "TempTable";
tableStyle.RowHeaderWidth = 20;
dataGrid1.TableStyles.Add(tableStyle);
}

///
/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.btnRefresh = new System.Windows.Forms.Button();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// btnRefresh
//
this.btnRefresh.Location = new System.Drawing.Point(32, 16);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(88, 32);
this.btnRefresh.TabIndex = 0;
this.btnRefresh.Text = "Refresh";
this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
//
// dataGrid1
//
this.dataGrid1.CaptionVisible = false;
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(8, 16);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ReadOnly = true;
this.dataGrid1.Size = new System.Drawing.Size(520, 208);
this.dataGrid1.TabIndex = 1;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.btnRefresh);
this.groupBox1.Location = new System.Drawing.Point(8, 0);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(536, 64);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.dataGrid1);
this.groupBox2.Location = new System.Drawing.Point(8, 72);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(528, 232);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(544, 309);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///

[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void btnRefresh_Click(object sender, System.EventArgs e)
{
DataTable table = new DataTable("TempTable");

DataColumn myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType("System.Int32");
myDataColumn.ColumnName = "ID";
myDataColumn.ReadOnly = true;
table.Columns.Add(myDataColumn);

myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType("System.String");
myDataColumn.ColumnName = "Description";
myDataColumn.ReadOnly = true;
table.Columns.Add(myDataColumn);

int start = new Random().Next(100);
for (int i = start; i <= start + 10; i++)
{
DataRow row = table.NewRow();
row["ID"] = i;
row["Description"] = "Desc - " + i.ToString();
table.Rows.Add(row);
}

dataGrid1.DataSource = table;
}
}
}
GeneralButton Control stoped working after installation of ASP.NET Framework 1.1 SP 1 Pin
Member 20320427-Sep-04 21:28
Member 20320427-Sep-04 21:28 
Questionis it timeout? Pin
zhebincong27-Sep-04 15:41
zhebincong27-Sep-04 15:41 
AnswerRe: is it timeout? Pin
zhebincong28-Sep-04 19:29
zhebincong28-Sep-04 19:29 
GeneralField updation in word document Pin
Anonymous27-Sep-04 11:01
Anonymous27-Sep-04 11:01 
GeneralTCP/IP Connection (over GPRS) - XDA and Desktop Pin
Viv K27-Sep-04 9:02
Viv K27-Sep-04 9:02 
GeneralWeekdays in the a custom language. Pin
Mattias Olgerfelt27-Sep-04 6:10
Mattias Olgerfelt27-Sep-04 6:10 
Generaldebugging VSIP package Pin
conman11027-Sep-04 2:55
conman11027-Sep-04 2:55 
GeneralIs this a bug in .NET Framework Pin
Volvere27-Sep-04 2:48
Volvere27-Sep-04 2:48 
GeneralProgress Bar that moves Pin
sampoo26-Sep-04 8:46
sampoo26-Sep-04 8:46 
GeneralRe: Progress Bar that moves Pin
kayhustle29-Sep-04 6:06
kayhustle29-Sep-04 6:06 
GeneralRe: Progress Bar that moves Pin
sampoo29-Sep-04 7:18
sampoo29-Sep-04 7:18 
GeneralWMI Listing running DLL's Pin
JDOnline25-Sep-04 22:57
JDOnline25-Sep-04 22:57 
GeneralRe: WMI Listing running DLL's Pin
bort19831-Oct-09 17:50
bort19831-Oct-09 17:50 
GeneralDatabase independent programming? (OLEDB or ODBC data Adaptor) Pin
Salil Khedkar23-Sep-04 21:33
Salil Khedkar23-Sep-04 21:33 
GeneralRe: Database independent programming? (OLEDB or ODBC data Adaptor) Pin
Colin Angus Mackay24-Sep-04 2:56
Colin Angus Mackay24-Sep-04 2:56 
GeneralRe: Database independent programming? (OLEDB or ODBC data Adaptor) Pin
Salil Khedkar27-Sep-04 23:40
Salil Khedkar27-Sep-04 23:40 
GeneralDo customers trust Web Services? (It runs on top of IIS, right?) Pin
Salil Khedkar23-Sep-04 21:19
Salil Khedkar23-Sep-04 21:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.