my gridview is displaying following values like this:-
id item_name price
----------------------------------------
1 abc 1231
2 def 2465
but i've to display price with "USD" which is come from web.config file.
so, it should be display like this:-
id item_name price
----------------------------------------
1 abc USD 1231
2 def USD 2465
how can i do that.
please provide me accurate solution.
i need it very urgently.
thanks.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 27, 2012, 9:38 PM EDT
before binding the datatable to gridview.
foreach(DataRow dr in datatable1)
{
dr["price"]=ConfigurationSettings.AppSettings["Currency"] + dr["Price"].ToString();
}
and in web.config.
Priyank Khare154 reputationPosted Sep 27, 2012, 9:49 PM EDT
because i think it will display an error during addition of price like "usd 1231 + usd 2465"
what will i do to resolve this problem.?
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 27, 2012, 9:53 PM EDT
http://humrahimcs.wordpress.com/2010/09/21/how-to-add-currency-symbol-in-gridview-priceamount-column/