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

Problem in winforms radgridview

8 Answers 399 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kari
Top achievements
Rank 1
Kari asked on 11 Feb 2011, 02:09 PM
I populate a radgridview from a class with a method: xxx.DataSource = class.method(); This methos returns a datatable.
The first time it works fine.
When i insert a row into the radgridview and repopulate it with the classes method (xxx.DataSource = class.method();
) it works fine.
But when i update the radgridview and after thet try to repopulate the radgridview, it starts to fire these messageboxes with the error message:

Data Exception
Column 'xxx' does not belong to table Table

What am i missing?

8 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 13 Feb 2011, 08:43 PM
Hello Kari,

A couple of questions. What version of RadControls are you using, and are you using Pinned Rows? I ask this because of this forum thread. If that's not the case, and you are using the latest version of the controls, please can you provide a small sample that replicates the issue and I'll be pleased to take a look at it for you.
thanks
Richasrd
0
Julian Benkov
Telerik team
answered on 16 Feb 2011, 11:03 AM
Hi Kari,

Like Richard suggested, please download and use the latest version of RadControls for Winforms. If you continue to experience the same issue, please send us a sample application to debug the case locally.

All the best,
Julian Benkov
the Telerik team

Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
0
Kari
Top achievements
Rank 1
answered on 16 Feb 2011, 01:27 PM
I'm using RadControls for winforms Q2 2010 SP2.
I've heard rumours that if i install a newer version of the control some methods stop working. Thats why i'm hesitasting on istalling a newer version.

What happens is that in page_load i call a method that populates the control, this works fine:

 datagridview1.DataSource = class1.DataSet.Tables[0];

Then when i insert a new row via:
 private void datagridview1_UserAddedRow(object sender, Telerik.WinControls.UI.GridViewRowEventArgs e) {
//... Do insert methods here...
//... Do the gridview update:
datagridview1.DataSource = class1.DataSet.Tables[0];
}

This gives the messageboxes i referred to earlier.







0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 16 Feb 2011, 01:54 PM
Hello,

From memory, there used to be an issue (as per the link I posted) with the error that you are getting, but as far as I know these are fully resolved. The largest breaking changes were in the Q2 2010 release which you are already on, and I'd strongly advise to upgrade, not least to take advantage of all the bug fixes, enhancements and latest controls that are offered.
You can find the release notes for the latest version here

Hope that helps
Richard
0
Suren
Top achievements
Rank 1
answered on 03 Aug 2012, 10:26 PM
looks like this bug is present with "Q2 2012" when used with following code , please someone verify

radGridView1.TableElement.BeginUpdate();
radGridView1.MasterTemplate.Columns.Clear();
radGridView1.DataSource = ds.Tables[0];
radGridView1.CurrentRow = null;
 
radGridView1.TableElement.EndUpdate();

"Data exception" thrown when running the same code for reloading the gridview for the 2nd time
0
Julian Benkov
Telerik team
answered on 08 Aug 2012, 02:56 PM
Hello Suren,

The code snipped used in your application is not working properly in this version of RadGridView and breaks the synchronization between the data engine and the UI rendering. The BeginUpdate / EndUpdate functionality must be called to the root control level or GridVievTemplate level. Here is a changed code snippet:
radGridView1.BeginUpdate();
radGridView1.MasterTemplate.Columns.Clear();
radGridView1.DataSource = ds.Tables[0];
radGridView1.CurrentRow = null;
radGridView1.EndUpdate();

The same update can be executed using also this type of API:
using (radGridView1.DeferRefresh())
{
    radGridView1.MasterTemplate.Columns.Clear();
    radGridView1.DataSource = ds.Tables[0];
    radGridView1.CurrentRow = null;
}

I hope this information is useful. Let me know if you need further assistance.

Kind regards,
Julian Benkov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Shokhi
Top achievements
Rank 1
answered on 08 Feb 2017, 11:06 AM

Hi,

I am using winforms with Telerik controls for my application. I am trying to fix my application on various screen resolutions and zoom. But the fix doesn't seems to be ok for every resolution.

For Example:

Considering my laptop's zoom is 100% (default) the application is appearing fine. But if I change the display settings  to 125% or change my screen resolution the forms are not appearing properly.

The size of the grid is changed. The font size of the application changes. 

How can I make this work despite of any resolution? I have tried changing properties of the win forms but that also didn't work.

What are the possible solutions for this?

0
Hristo
Telerik team
answered on 08 Feb 2017, 12:04 PM
Hi ,

Thank you for writing.

Your question does not appear to be directly related to the subject discussed here. Please note that we strive to keep our threads well organized and focused on a single topic. 

Regarding the observed on your end behavior, it appears that it is related to the DPI settings: WinForms Scaling at Large DPI Settings–Is It Even Possible?. In case you need further assistance please open up a support ticket or a new forum thread describing your issue.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Kari
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Julian Benkov
Telerik team
Kari
Top achievements
Rank 1
Suren
Top achievements
Rank 1
Shokhi
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or