.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Using Custom Regional Settings in WPF

Posted By:      Posted Date: October 08, 2010    Points: 0   Category :WPF

I am creating a localized WPF application and i want WPF to use whatever settings i have in my regional settings.

All over the internet they recommend the following code, which i did use

protected override void OnStartup(StartupEventArgs e)
    new FrameworkPropertyMetadata(

Now, let's suppose that in the regional settings i'm still using en-US but i have decided to show the currency as 1 digit after the decimal point instead of 2

If i use this code, it works perfectly

decimal d = 2.5M;

but when i use binding, i still get both digits after the decimal point


View Complete Post

More Related Resource Links

Convert English to Arabic number without changing any regional settings in .net

Well, most applications that I worked with was multilingual that supports English UI and Arabic UI.

And one of the major issue that we have faced is displaying Arabic numbers without the need of changing the regional settings of the PC.

So the code below will help you to display Arabic number without changing any regional settings.

User Preferences: Manage User Settings in Your .NET App with a Custom Preferences API


There are plenty of options out there for managing user preferences including custom configuration files, the Windows registry, and the isolated storage. But each option has its pros and cons -- and a bad choice can make life difficult. In this article, the author evaluates various options and identifies the characteristics of a good preferences API. Based on those characteristics, he introduces an API that is specifically designed for preferences management, one that offers the best of all the options.

Ray Djajadinata

MSDN Magazine July 2004

Apply custom.master to "Site Settings" page?


I'm using a custom.master page, which is applied to almost all pages available to READ users.

However, I'd like to apply it to the Search, Site Settings, and View All Site Content pages.

I'm not sure where this would be applied.

Guidance much appreciated. Thanks!

Change Regional Settings

I need to change regional settings on SharePoint so that the date format is not mm/dd/yyyy but dd/mm/yyyy.I have seen that this can take place if i go to Home site->Site Settings->Regional Settings and change the locale from there. All are perfect up to here. Since i need this change to take effect on subsites as well I check the "All sub-sites inherit these Regional Settings". After Pressing ok, i get an error message "Please turn off all indexed columns before changing the collation of this site. One or more list or library contains a column that has been marked for indexing. ..."How can i stop this indexing temporary? i tried to stop the indexing service from service administration but this didn't work.After applying this change, i hope my dates will not be lost, correct (this is the production server.....)? Will i have any problem with the search? Do i need further actions?a.rongas

Dynamic list item title based on date created & regional settings?

I have a list of things that doesn't *need* a title.  However, because sharepoint uses Title for links, RSS etc  I tried generating a title in an event handler.   This would work great if I wasn't basing it on a date field: public override void ItemAdding(SPItemEventProperties properties) { DateTime dt = Convert.ToDateTime(properties.AfterProperties["TestDate"]); properties.AfterProperties["Title"] = dt.ToShortDateString(); base.ItemAdding(properties); } In testing, this sets the title to "8/9/2010" when I selected 8/10/2010 in the date picker.  I figure this is because of the regional settings of my test user.  I can probably correct the title value for 'test user' but that won't fix 'test user in mongolia' who would still see two different values. So What I would like is to have the Title always display the value MyDate in the uesr's locale.  So the field needs to be dynamic not only at edit/update time, but at display time. Does anybody know if this can be accomplished, and more specifically how?

Convert user.config to database storage via my custom settings provider



I've created my own custom settings provider to save user settings (formerly in the user.config) to a database. To point the particular settings that are to be saved to the database I specified

for each property to point to the BlobSettingsProvider instead of allowing them to default to the LocalFileSettingsProvider.
Now I need to convert existing user.configs to save to the database on the fly - a one time conversion. Because I've now specified the properties to use the BlobSettings provider they can no longer access the local user.config.
Does anyone have any thoughts on how best to accomplish this conversion (i.e. read the local user.config and populate the BlobSettingsProvider). The app can be run as a ClickOnce installed app or as a simple .net app - finding the correct local user.config looks to be a problem.
Thoughts, ideas,...?


Regional settings impacts Caml DateTime query



I am using the GetListItems web service to retrieve items from a list where my custom column UpdateCompleted is less than or equal to a given datetime. But, I noticed some weird behaviour of SharePoint 2007 going on. The query would perform differently when I changed my regional settings on the site settings page of SharePoint! When regional settings were set to UTC my query would select the items, when in GMT it would not.

I have specified my query to use a DateTime in UTC form (ends with Z) and I have also specified DateInUtc to TRUE in the query options. So I would expect SharePoint to do a UTC date compare despite what the site regional settings are set to.

This is my query:

<Query><Where><And><Eq><FieldRef Name='Status'></FieldRef><Value Type='Text'>Unlocked</Value></Eq><Leq><FieldRef Name='UpdateCompleted'></FieldRef><Value Type='DateTime' IncludeTimeValue='TRUE'>2010-10-08T18:40:21Z</Value></Leq></And></Where></Query>

This is my query options:

My regional Settings


On our Project 2010 site only users with contribute permissions have the option to change their regional setting through the users My Settings properties , but users with more restrictive  access to the site do not see the option to change their My regional settings . They only see the My Alerts . is there a way to enable this for all users ?

Regional settings (locale) in SP - is there any way to change that settings? eg. date format

The system I use is MOSS2007. I have regional settings set to "Polish". The default date format is yyyy-mm-dd, what is wrong because usually is dd-mm-yyyy. Is there any way to change specific regional settings? I couldn't have found it on internet. I've tried to change to "French", which gives me dd-mm-yyyy, but then eg. in calendar I have days and months in French language :)

Forms Services Regional Settings


When a user selects a date with the Date Picker control, the date is entered as mm/dd/yy. In Australia we use a slightly reversed date format to the default US setting: dd/mm/yy.

I have checked the regional settings in the following placed, but they're all set to Australia:
1. The SharePoint site that's hosting my form (i.e. the list that has my form as a content type).
2. The SharePoint front-end web server that's hosting the SharePoint web application.
3. My local PC.

Is there some other place I need to set the region?



Add a RichTextField in the "Additional Column Settings section" on custom field type



I have created at custom field type that will be used in a Custom List.

Almoste everything works ok, but there is one feature I can't figure out how to solve.

When I create the new column I want a custom property, displayed in the Addidional Column Settings sections. I know that I can easily solve this by adding a field in the xml-file, in the propertyschema section.

I want the custom property to be a RichTextField, but all I manage to create is a multiline textbox... Is it possible to do this??

Here is the xml I am using...

    <Field Name="TypeName">UserInfo1</Field>
    <Field Name="ParentType">Text</Field>
    <Field Name="TypeDisplayName">Login User Information</Field>
    <Field Name="TypeShortDescription">Current Login User Name</Field>
    <Field Name="UserCreatable">TRUE</Field>
    <Field Name="Sortable">TRUE</Field>
    <Field Name="AllowBaseTypeRendering">TRUE</Field>
    <Field Name="Filterable">TRUE</Field>
    <Field Name="FieldTypeClass">CustomFieldTypes.MyCustomField, CustomFieldTypes, Version=, Culture=neutral, PublicKeyToken=xxxx</Field>

Display an SSRS Report in multiple (user's) regional settings



I have an SSRS Report that I've developed that returns date values. I have users that will access this report globally, and I would prefer that the report return these dates in the format tied to their regional settings.

I have set the RDL Language property to the expression =User!Language. this works on my local development environment.

Then I published to my ReportServer (MOSS 2007). Now no matter what regional settings my PC is tied to, both the report paramters and date format display in whatever Regional setting my SharePoint site is set to.

Is there a way that I can dynamically display the report using the User's regional settings?


Global Nav on Custom Masterpage not Inheriting Settings



I currently have a Publishing site with workflow and multiple subsites that are also publishing sites. The global nav on the subsites needs NOT to inherit the links from the parent site. The system pages are reflecting these settings correctly, but the pages with the custom master attached are not... They all show the same navigation as the parent site, regardless of any changes to the navigation settings.

I have carefully checked the global nav control for the custom master, and it is identical to the global nav in the v-4 master. I've also tried removing custom styles as a last resort and have not found a reason in the custom master, for this problem to be occurring.

Has anyone experienced this issue before and found a solution?

Any help would be much appreciated!

Rebecca Zimmerman

How to change the URL in Search Settings to use Custom Scopes.



How can I change programmatically the URL for the Custom Scopes?

It's in the Administration -> "Search Settings".



Site Settings page empty-blank, Site Actions not clickable in custom site created programmatically f



We are migrating from MOSS 2007 to SharePoint 2010 and testing custom code used for creating sites. Sites were used to be created based on a site template, 'STP' file. In 2010, there are no more 'STP' files, instead 'WSP' solution packages are used, so we created a new WSP site template in Solutions gallery. The custom code uses that WSP for creating sites now.

But, when a site is created, and when you go to Site Settings from Site Actions menu, it load empty page - no any settings links or anything, just a blank page (/_layouts/settings.aspx). Also, Site Actions menu becomes unclickable.

Has anybody seen something like this?

Thanks a lot!


Regards, R.D.M.

Custom masterpage styling does not apply to forms, settings, etc.



I have created a custom master page and changed the default left-navigation so that the first level is shown and the second level is pop-out (plus a few other small changes).

The color changes apply to all pages.  However, the navigation changes do not apply to the list forms (new, view, edit) when viewed outside of the pop-out, nor do they apply to site settings pages.  Why wound't the masterpage work for all?  Is there another page to modify?


Custom Controls in C# .NET

Embedding user controls in a Windows form is just like adding a simple button or text box that are already provided with .NET. These basic controls were written essentially like you code your own controls. Typically the controls you design are to be used in multiple forms or to modularize your code. These reasons help reduce the amount of code you have to type as well as make it easier for you to change your implementation. There should almost never be any reason to duplicate code because it leaves a lot of room for bugs. So, implementing functionality specific to your control in the control's source code is a good idea. This reduces code duplication as well as modularize your code, which is a good programming guideline.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend