In the following example, I am explaining how to bind all the currencies list to a Dropdownlist in Asp.Net.
Step-1: Add a dropdownlist to your page(ddlCurrency).
Step-2: Add 'using System.Globalization;' namespace to your .aspx.cs.
Step-3: Write the following method to select currencies and bind to dropdownlist.
Step-4: Call this method whenever you required to bind your dropdownlist.
Output:
Your valuable comments will be highly appreciated.
Regards,
Prajanuranjan....
Step-1: Add a dropdownlist to your page(ddlCurrency).
Step-2: Add 'using System.Globalization;' namespace to your .aspx.cs.
Step-3: Write the following method to select currencies and bind to dropdownlist.
public void
GetCurrenciesList()
{
foreach (CultureInfo
item in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
if (item.IsNeutralCulture != true)
{
RegionInfo region = new RegionInfo(item.LCID);
string CurrencyName = region.CurrencyEnglishName;
string CurrenctSymbol =
region.ISOCurrencySymbol;
ListItem li = new ListItem(CurrencyName + "(" + CurrenctSymbol + ")", CurrenctSymbol);
//** To check whether the Currency has
already been added to the list or not ***//
if (ddlCurrency.Items.Count > 0)
{
int i = 0;
foreach (ListItem Curr in ddlCurrency.Items)
{
if (Curr.Value.Trim().ToLower() ==
li.Value.Trim().ToLower())
{
i++;
}
}
if (i == 0)
{
ddlCurrency.Items.Add(li);
}
}
//***********************************************************************//
else
{
ddlCurrency.Items.Add(li);
}
}
}
//*************** To sort the dropdownlist items
alphabatically *************//
List<ListItem>
listCopy = new List<ListItem>();
foreach (ListItem
item in ddlCurrency.Items)
{
listCopy.Add(item);
}
ddlCurrency.Items.Clear();
foreach (ListItem
item in listCopy.OrderBy(item => item.Text))
{
ddlCurrency.Items.Add(item);
}
//**************************************************************************//
ddlCurrency.Items.Insert(0, "Select");
}
nice
ReplyDeleteThank you for allowing me to read it, welcome to the next in a recent article. And thanks for sharing the nice article, keep posting or updating news article.
ReplyDeleteData Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
selenium training in chennai
Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
ReplyDeletejava training in chennai | java training in bangalore
java online training | java training in pune
java training in chennai | java training in bangalore
Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
ReplyDeletepython training in pune
python online training
python training in OMR
Outstanding blog post, I have marked your site so ideally I’ll see much more on this subject in the foreseeable future.
ReplyDeleteBlueprism training in marathahalli
Blueprism training in btm
Blueprism online training
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeleteangularjs Training in chennai
angularjs-Training in pune
angularjs-Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
Your blog stuffed with lot of latest technologies news. Thanks for refreshing my mind.
ReplyDeleteSelenium training in chennai
Selenium training institute in Chennai
iOS Course Chennai
Digital Marketing Training in Chennai
Big Data Hadoop Training in Chennai
Best hadoop training institute in chennai
This is exceedingly helpful information, very good work. Thanks for sharing and let me wait for further updates.
ReplyDeleteData Science Course in Chennai
Data Science Training in Chennai
DevOps certification in Chennai
DevOps Training in Chennai
AWS Training in Chennai
AWS course in Chennai
Data Science Training in Velachery
Data Science Training in Tambaram
I have visited this blog first time and i got a lot of informative data from here which is quiet helpful for me indeed.
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Python online training
uipath online training
Nice Tutorial. It is easy to understand the Concept of this Blog very clear and easy to understand the Concept.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
The Article is really Nice. Easy Tom understand the Concept . content should be Very Clear.
ReplyDeleteData Science Training Course In Chennai | Data Science Training Course In Anna Nagar | Data Science Training Course In OMR | Data Science Training Course In Porur | Data Science Training Course In Tambaram | Data Science Training Course In Velachery
This is beyond doubt a blog significant to follow. You’ve dig up a great deal to say about this topicgood luck.
ReplyDeleteAi & Artificial Intelligence Course in Chennai
PHP Training in Chennai
Ethical Hacking Course in Chennai Blue Prism Training in Chennai
UiPath Training in Chennai
"Good Posting. Extra-ordinary way to narrate the concepts. Thanks for sharing..
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
"
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging
ReplyDeleteDigital Marketing Training Course in Chennai | Digital Marketing Training Course in Anna Nagar | Digital Marketing Training Course in OMR | Digital Marketing Training Course in Porur | Digital Marketing Training Course in Tambaram | Digital Marketing Training Course in Velachery
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. thanks a lot
ReplyDeleteJava training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training
This is good site and nice point of view.I learnt lots of useful information.
ReplyDeletesap training in chennai
sap training in tambaram
azure training in chennai
azure training in tambaram
cyber security course in chennai
cyber security course in tambaram
ethical hacking course in chennai
ethical hacking course in tambaram
This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us.
ReplyDeleteoracle training in chennai
oracle training in annanagar
oracle dba training in chennai
oracle dba training in annanagar
ccna training in chennai
ccna training in annanagar
seo training in chennai
seo training in annanagar
First i got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks.
ReplyDeletehardware and networking training in chennai
hardware and networking training in porur
xamarin training in chennai
xamarin training in porur
ios training in chennai
ios training in porur
iot training in chennai
iot training in porur
Thanks for sharing a very useful post! It was very nice to read and informative indeed !
ReplyDeletedata science training in chennai
ccna training in chennai
iot training in chennai
cyber security training in chennai
ethical hacking training in chennai
betmatik
ReplyDeletekralbet
betpark
mobil ödeme bahis
tipobet
slot siteleri
kibris bahis siteleri
poker siteleri
bonus veren siteler
XZİT1N
شركة مكافحة حشرات بالدمام 6EvzX1840Z
ReplyDeleteشركة مكافحة الصراصير بالدمام ENRStgXVef
ReplyDelete