views:

552

answers:

4

Hi sir,

I have a gridview and a dropdownlist on my page. The gridview is binded through code behind with some columns. Among these price is also a column.

My scenario is to change the price field based on the dropdown criteria.

The price column consists of values in "lakhs", and i need to change them as crores or usd or some other format as per dropdown.

I don't want to go for postbacks. I want these to be implemented using javascript.

(These changes are for user conversion. They need not to be saved on database)

Thanks in advance Madhu

A: 

You have two options. If you don't want to go for any response from the server (i.e. you don't want to make an AJAX call), you could populate a hidden field with a list of comma-delimited values that correspond to your dropdown values. It's an ugly approach, but it would work.

The other option is to make an AJAX call to a web method on the server (or possibly a financial service like Yahoo! Finance). When your dropdown selected value changes, that event fires a call to the server.

If you were able to indicate what platform you're using (PHP, .Net or other), someone will likely be able to provide more relevant examples and code samples.

Phil.Wheeler
Thanks for your reply.I am using asp.net with c#.I dont want to go for first suggestion listed. The second option makes use of server call. My requirement is to handle it on client side.(for ex: changing the contents on table rendered and making use of innerhtml property)I dont want to use any of financial services. I will write javascript code to do the conversions.Thanks
Madhu
A: 

Since the grid is rendered as an HTML Table, you can actually manipulate anything on the client.

I would pickup jQuery for the task

Tzury Bar Yochay
A: 

Thanks for your reply.

I am using asp.net with c#.

Can you show me a sample code.

Thanks

Madhu
A: 

Thanks for your reply. I am using asp.net with c#. I dont want to go for first suggestion listed. The second option makes use of server call. My requirement is to handle it on client side.(for ex: changing the contents on table rendered and making use of innerhtml property) I dont want to use any of financial services. I will write javascript code to do the conversions. Thanks – Madhu

Madhu