This is a migrated thread and some comments may be shown as answers.

Crash with SP2

3 Answers 38 Views
GridView
This is a migrated thread and some comments may be shown as answers.
johns
Top achievements
Rank 1
johns asked on 24 Oct 2007, 12:30 PM
This thread seems to have disappeared.  Is there a fix as the work around you posted does not prevent the crash.

From: telerik
Date: 10/17/2007 10:31:13 AM
Hello John,

Thank you for contacting us. This behavior will be corrected for the upcoming release.

The issue you are experiencing is caused when items are added in a BeginUpdate / EndUpdate block. In your case that happens when the datasource is changed. For the time being, please, move the line:

radGridView1.DataSource = m_dataTable;

after the following line:

radGridView1.GridElement.EndUpdate();

If you have any additional questions, please do not hesitate to contact us.

Sincerely yours,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center




From: johns
Date: 10/17/2007 9:54:37 AM

I've had some code that binds a grid to a DataTable.  Periodically the DataTable is rebuilt and fields are added or removed based on what is available from a query.  I've distilled the crash to the following code.  This used to work fine prior to upgrading to SP2.  Is there somthing I am overlooking or is there a bug in the new RadGridView.

public partial class Form1 : Form

 

{

public Form1()

{

InitializeComponent();

}

private void radButton1_Click(object sender, EventArgs e)

{

radGridView1.GridElement.BeginUpdate();

radGridView1.DataSource = null;

radGridView1.MasterGridViewTemplate.Columns.Clear();

radGridView1.Rows.Clear();

 

// Rebuild DataTable and Grid based on changes

 

GridViewTextBoxColumn column1 = new GridViewTextBoxColumn("C1 Text");

column1.DataField = "C1 Text";

column1.Width = 90;

GridViewTextBoxColumn column2 = new GridViewTextBoxColumn("C2 Text");

column2.DataField = "C2 Text";

column2.Width = 130;

column2.DataType = typeof(DateTime);

 

radGridView1.MasterGridViewTemplate.Columns.Add(column1);

radGridView1.MasterGridViewTemplate.Columns.Add(column2);

/*

*..... Add other Fields to Table and Grid based on available Data.

*/

 

m_dataTable.Clear();

m_dataTable.Columns.Clear();

m_dataTable.Columns.Add("C1 Text", typeof(String));

m_dataTable.Columns.Add("C2 Text", typeof(DateTime));

 

radGridView1.DataSource = m_dataTable;

radGridView1.GridElement.EndUpdate();

radGridView1.Update();

 

}

DataTable m_dataTable = new DataTable("TheData");

}





3 Answers, 1 is accepted

Sort by
0
Vassil Petev
Telerik team
answered on 24 Oct 2007, 03:51 PM
Hello johns,

In your first ticket you mention that the problems are in the SP2. I suppose you mean Q1 SP2? There are some issues in this version and that is why we suggest you to upgrade to Q2 SP1 version. If you still have troubles after upgrading, please, create a simple project and send it to us for analysis.

Your previous post was been moved to the support area to enable attachments. Feel free to use it for sending the files.


Best wishes,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
johns
Top achievements
Rank 1
answered on 24 Oct 2007, 04:07 PM
Sorry, this applies to the very latest version Q2, SP1.
The code in the first post reproduces the problem.  If you still need a project I will put one together.
0
Dwight
Telerik team
answered on 28 Oct 2007, 10:48 AM
Yes, johns, we would prefer to see your project. We did fix a similar issue with Q2 SP1, but we would like to check whether you have not stumbled on something else. 

Thanks in advance.
 

Sincerely yours,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
johns
Top achievements
Rank 1
Answers by
Vassil Petev
Telerik team
johns
Top achievements
Rank 1
Dwight
Telerik team
Share this question
or