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

AddNewRow with DefaultValues in GridView

2 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
OD
Top achievements
Rank 1
OD asked on 10 Feb 2017, 04:59 PM

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 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 13 Feb 2017, 02:02 PM
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.
0
OD
Top achievements
Rank 1
answered on 13 Feb 2017, 03:22 PM

Thanks for your answer.

Your workaround is working :)

Tags
GridView
Asked by
OD
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
OD
Top achievements
Rank 1
Share this question
or