Problem in winforms radgridview

7 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. UI for WinForms is Visual Studio 2017 Ready
  4. 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.
  5. 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.







  6. 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
  7. 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
  8. 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 >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready