Results 1 to 4 of 4

Thread: Local culture setting ignored by Data binding

  1. #1
    Join Date
    Nov 2009
    Posts
    1,191

    Local culture setting ignored by Data binding

    Hello there,

    I am developing a program using the .NET programming language in which i am using the ToString() function to bind the property of window culture setting to the program but the the data binding ignores the local culture setting which is not working according to me and the date which is displaying in the program is different then the computer timing . Now i don't understand that what to do help me if any body have the solution for the same.

    Thanks in advance. Waiting for the reply!!!!!!!

  2. #2
    Join Date
    May 2008
    Posts
    3,316

    Re: Local culture setting ignored by Data binding

    As per my knowledge how it is possible that your program is not taking the system timing because string conversion always follow the default setting for the culture setting. But this can be possible due to the binding convert. It is little different from type converting which takes the local setting.

    Code:
    <GroupBox Header="Setting up with the Machine culture" 
    Language="{Binding CurrentLanguage}">
    <StackPanel Orientation="Vertical">
    <TextBlock Text="Number: "/>
    <TextBlock Text="{Binding Number}"/>
    </StackPanel>
    <StackPanel Orientation="Horizontal">
    <TextBlock Text="Date: "/>
    <TextBlock Text="{Binding DateTime, ConverterCulture={x:Static local:CultureWindow.CurrentCulture}}"/>
    </StackPanel>
    </GroupBox>
    
    public static CultureSetting CurrentCulture
    {
     get
     {return Thread.CurrentThread.CurrentCulture;}
     }

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Local culture setting ignored by Data binding

    Hello Folks,

    This problem might be solved with the help of WPF team. It is not that difficult to do. I can be sorted out with the help of the System.Windows.Markup.XmlLanguage to check for the requested language tag is by mistake is same as CultureInfo.CurrentCulture. If it is the same then use this culture instead of a installed culture. Thats all i can help you, say thanks if you like the idea.

    Bye

  4. #4
    Join Date
    Apr 2008
    Posts
    2,139

    Re: Local culture setting ignored by Data binding

    Hi there,

    I am posting this for the problem your are facing. just check it get the help with your issue. The code for the same is given below
    Code:
    <local:DateConverter x:Key="DateChanger"/>
    <data:DataGrid IsReadOnly="True" x:Name="GridDetail" Margin="10,8,0,0" Grid.Column="2" AutoGenerateColumns="True" HorizontalAlignment="Center" Grid.Row="2" Height="250" VerticalAlignment="Top" Width="1000">            <data:DataGrid.Columns>               
    <data:DataGridTextColumn Binding="{Date of the Binding, Converter={StaticResource DateTimeConverter}}" Header="Content"/>                    <data:DataGridTextColumn Binding="{Binding duration}" Header="Binding" />
    <data:DataGridTextColumn Binding="{Comment}" Header="Data Binding" /> 
    </data:DataGrid.Columns>    
    </data:DataGrid>

Similar Threads

  1. How to setup a data plan from iPad 3 Cellular data Setting
    By Mr.Ryszard in forum Portable Devices
    Replies: 3
    Last Post: 29-03-2012, 04:11 PM
  2. Gumbo FlexGlobals.topLevelApplication data binding issues
    By Latafat in forum Software Development
    Replies: 7
    Last Post: 17-07-2010, 12:07 AM
  3. What is Data Binding?
    By Rum in forum Software Development
    Replies: 5
    Last Post: 29-01-2010, 12:15 PM
  4. Vista Unlock Administrator with Local Security Policy Setting
    By Emily123 in forum Operating Systems
    Replies: 3
    Last Post: 19-05-2009, 08:37 PM
  5. problem in setting up Local Interanet connection
    By Shell in forum Networking & Security
    Replies: 4
    Last Post: 22-10-2008, 08:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,514,435.44397 seconds with 17 queries