AddNewRow with DefaultValues in GridView

3 posts, 0 answers
  1. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 10 Feb 2017 Link to this post

    Hello,

    I'm using a GridView for which I'm defining some default values.

    When clicking on the NewRow, it displays the default values but if the user doesn't change any of row values, the row is never validated.

    In the DefaultValuesNeeded event, I'm actually defining a specific column to have a specific ID each time, and I wish this could be sufficient to be able to validate the row. This used to work in Winforms Q1 2015...

  2. Dimitar
    Admin
    Dimitar avatar
    2951 posts

    Posted 13 Feb 2017 Link to this post

    Hello Jean,

    I can confirm that this is considered an issue which I have logged in our Feedback Portal. I have added a vote for it on your behalf as well. You can track its progress, subscribe for status changes and add your comment to it here. I have also updated your Telerik Points.

    To workaround this you need to set the originalValue field which will simulate an edit operation:
    private void RadGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
    {
        var editor = radGridView1.ActiveEditor as BaseInputEditor;
        var field = editor.GetType().GetField("originalValue", BindingFlags.NonPublic | BindingFlags.Instance);
        field.SetValue(editor, "asd");
    }

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    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.
  3. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 13 Feb 2017 in reply to Dimitar Link to this post

    Thanks for your answer.

    Your workaround is working :)

Back to Top