[Solved]Keep Cgridview Selection After Submit

Good morning.

Is there any way to keep the selection of a CGridView if form submit fails because the data already exists?

I want save into database FiledName=‘xxx’, but ‘xxx’ data already exists in database. Then, it shows the validation notice, but loses the seleccion of a possible CGridView in same page.


Anybody has faced this scenario?


if I understand you correct, you have both a grid view and a form on the same page. If so, you could try to use CActiveForm and utilize its ajax-validation capability. It will allow to perform validation without page reload, unless we sure that data in the form is correct.

Thanks for reply.

I’m thinking another way to do it, and if I get, I’ll post here.

Anyway any idea is welcome.


I used SelGridView extension and it works!