Problem in winforms radgridview

9 posts, 1 answers
  1. Kari
    Kari avatar
    6 posts
    Member since:
    Jan 2008

    Posted 11 Feb 2011 Link to this post

    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?
  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 13 Feb 2011 Link to this post

    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
  3. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 16 Feb 2011 Link to this post

    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.
  4. Kari
    Kari avatar
    6 posts
    Member since:
    Jan 2008

    Posted 16 Feb 2011 Link to this post

    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.







  5. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 16 Feb 2011 Link to this post

    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
  6. Suren
    Suren avatar
    12 posts
    Member since:
    Jul 2012

    Posted 03 Aug 2012 Link to this post

    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
  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 08 Aug 2012 Link to this post

    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 >>
  8. Shokhi
    Shokhi avatar
    1 posts
    Member since:
    Dec 2015

    Posted 08 Feb Link to this post

    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?

  9. Hristo
    Admin
    Hristo avatar
    865 posts

    Posted 08 Feb Link to this post

    Hi Shokhi,

    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.
Back to Top