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

How to force Delete a row which has failed validation

4 Answers 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Edward Pauley
Top achievements
Rank 1
Edward Pauley asked on 20 Apr 2011, 12:01 AM
Hi

I am using radDomainDataSource + ria service + entity framework 4
on the metadata file of my service i have some markup attribute for doing validation of the entity (such as Required attribute, ForeignKeyContrainst custom validation)

The current problem which i am facing with the radgridview is that whenever a row has a Validation appearing ,the user MUST fix the input data to the correct format(satisfying my required validation) before being able to delete that row
My question is that how i can override that default behavior of your radgridview???
because i want the user to be able to delete the row which fails the validation right away

For example, considering the situation that the user pressing multiple Insert key but not input any data. Of course, the new row will show the red validation. However, the user should be able to delete them if they want

plz help

thank you

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 20 Apr 2011, 08:02 AM
Hello Edward Pauley,

Please take a look at this forum thread for further reference and let me know whether it fits into your requirements. 

 

Best wishes,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Edward Pauley
Top achievements
Rank 1
answered on 20 Apr 2011, 08:28 AM
Hi Maya

thank you for your reply. However, i don't think the solution link which you give me apply for my case. Indeed , the link has the same problem with me but i am using Entity Framework 4 + ria service . So all of my data are Entity type(default of entity framework) which will be retrieve from server so i don't think i can add the interface IEditable to my Entity.

can you possible provide a solution of forcing delete if we use Entity framework and RIA service?

thank you
0
Edward Pauley
Top achievements
Rank 1
answered on 21 Apr 2011, 07:51 PM
Hi

i still need help with this one. Try all of the methods which i can think of but still no luck


thanks
0
Maya
Telerik team
answered on 22 Apr 2011, 08:23 AM
Hi Edward Pauley,

Basically, the Entity does implement both IEditableObject and INotifyDataErorInfo Interfaces. However, as it is in the Northwind database, the setter of the property perform its own validation logic and before setting the entire object, it checks whether there is any validation errors. Consequently, the focus cannot be removed from the cell unless defining valid value.
Thus the implementation of the correct behavior depends on your custom scenario and settings. Still, the idea should be as the one demonstrated in the sample attached in the mentioned forum thread - to validate the value in the setter of the property and clear the errors. 

Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Edward Pauley
Top achievements
Rank 1
Answers by
Maya
Telerik team
Edward Pauley
Top achievements
Rank 1
Share this question
or