Replacing link in cgridview with drop down

Hi,

I have a ling in my cgridview. on click of the link i want the link to be replace with a drop down having data from the database. after selecting the data from the database, I want the link to appear with the chosen field again and update the database. Could someone please help me with this.

Thanks in Advance.

What is the point of the link in this case?

Wouldn’t be better to just have the dropdown there… and the current value selected?

Thanks for replying…but thats not how I need it…Could you suggest how to do it the way i aksed?

To do it the way you ask is much difficult… you need to use jQuery and ajax… by clicking the link first time an ajax call would be made that would return the SELECT statements and would update the field content… after that when the select value would be chosen another ajax call would be made that would save the data you want and would return the new link to be updated…

I understood the logic…but i don’t know how to call the ajax insdie the grid…could you give me the code for that?

This is not an easy task and can be done in different ways… but you need to know and understand jQuery and ajax functionality…

The best and easiest way is to write the pure JS/jQuery code and register it with registerScript()