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

Edit form in radgrid control does not retain value when server-side validation failed

3 Answers 194 Views
Grid
This is a migrated thread and some comments may be shown as answers.
My Nguyen The
Top achievements
Rank 1
My Nguyen The asked on 08 Feb 2010, 07:54 AM
I have a radgrid control bind to an object datasource. In the business layer, I have some validation check to make sure input data is valid and if it not the business layer wil throw an exception.

In the ItemUpdated event of the radgrid, I have write some logic to catch the exception from the business layer:

            If e.Exception IsNot Nothing Then 
                e.ExceptionHandled = True 
                e.KeepInEditMode = True 
 
                Response.Write(e.Exception.Message) 
            End If 

Everything works fine except that the edit form of radgrid control does not retain the new value when server-side validation failed.

I was trying to apply that logic to a form view / detail view and everything works as expected, when server-side validation failed, the new values are remain and the user can modify the invalid one and perform update action again.

Am I missing some thing with the radgrid control ?
Any help would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 09 Feb 2010, 03:16 PM
Hi,

Please  refer to the forum link below where a solution has been provided on how  to  access the old and  new values in ItemUpdated, ItemInserted and ItemDeleted .

http://www.telerik.com/community/forums/aspnet-ajax/grid/accessing-old-amp-new-values-in-itemupdated-iteminserted-and-itemdeleted.aspx


Hope this helps.

Thanks,
Princy
0
My Nguyen The
Top achievements
Rank 1
answered on 10 Feb 2010, 01:27 AM
Hello Princy,

I've followed the instruction in the link that you gave me and it works like a charm.

Thanks for your help.
TheMy
0
RvdGrint
Top achievements
Rank 1
answered on 10 Jun 2011, 10:38 AM
Princy,

On performInsert in the ItemCommand I do some server validation on my record. Now after de postback the values that were entered by the user are lost. Can you please telle my if and how I can use the hashtables mentioned in this thread to set the screenvalues back after postback?

Jos.
Tags
Grid
Asked by
My Nguyen The
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
My Nguyen The
Top achievements
Rank 1
RvdGrint
Top achievements
Rank 1
Share this question
or