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
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
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
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.
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
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
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
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?
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