Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to find the Selected Column Name of ListView Control ? Pin
Paramu197318-Jan-12 19:22
Paramu197318-Jan-12 19:22 
QuestionTeam Foundation server ???? Pin
Pierre besquent17-Jan-12 22:01
Pierre besquent17-Jan-12 22:01 
AnswerRe: Team Foundation server ???? Pin
Pete O'Hanlon17-Jan-12 22:28
mvePete O'Hanlon17-Jan-12 22:28 
GeneralunRe: Team Foundation server ???? Pin
Pierre besquent17-Jan-12 22:58
Pierre besquent17-Jan-12 22:58 
AnswerRe: Team Foundation server ???? Pin
RobCroll18-Jan-12 15:15
RobCroll18-Jan-12 15:15 
QuestionError while compile a default C# template grid Pin
alex_petrov17-Jan-12 13:02
alex_petrov17-Jan-12 13:02 
AnswerRe: Error while compile a default C# template grid Pin
Richard MacCutchan17-Jan-12 23:06
mveRichard MacCutchan17-Jan-12 23:06 
QuestionSpeech recognition and drawing Pin
momo.pomo17-Jan-12 9:15
momo.pomo17-Jan-12 9:15 
AnswerRe: Speech recognition and drawing Pin
Not Active17-Jan-12 9:58
mentorNot Active17-Jan-12 9:58 
AnswerRe: Speech recognition and drawing Pin
Pete O'Hanlon17-Jan-12 10:08
mvePete O'Hanlon17-Jan-12 10:08 
JokeRe: Speech recognition and drawing Pin
Not Active17-Jan-12 10:17
mentorNot Active17-Jan-12 10:17 
AnswerRe: Speech recognition and drawing Pin
Dave Kreskowiak17-Jan-12 11:03
mveDave Kreskowiak17-Jan-12 11:03 
GeneralRe: Speech recognition and drawing Pin
Albert Holguin17-Jan-12 11:24
professionalAlbert Holguin17-Jan-12 11:24 
AnswerRe: Speech recognition and drawing Pin
Luc Pattyn17-Jan-12 11:57
sitebuilderLuc Pattyn17-Jan-12 11:57 
AnswerRe: Speech recognition and drawing Pin
venomation18-Jan-12 2:30
venomation18-Jan-12 2:30 
QuestionModal Form in WeifenLuo.WinFormsUI.Docking Pin
Member 150645617-Jan-12 4:47
Member 150645617-Jan-12 4:47 
AnswerRe: Modal Form in WeifenLuo.WinFormsUI.Docking Pin
Pete O'Hanlon17-Jan-12 5:00
mvePete O'Hanlon17-Jan-12 5:00 
Questionunable to bind to TextBox.Text Pin
Giorgi Nistor16-Jan-12 23:16
Giorgi Nistor16-Jan-12 23:16 
Hi
This is my first binding and it is not working.
It is set to TwoWay and it seems to update source data with the data from text box.
Ít doés not update the data from TextBox.

HTML
    <Window.Resources>
        <c:CMyData x:Key="mObj" pText="George"/>
    </Window.Resources>
    
    
    <DockPanel Name="dockPanel1">
        <Border BorderBrush="Silver" BorderThickness="1" Name="border1" DockPanel.Dock="Top" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="50">
            <Button Content="Button" Name="button1" Height="47" Click="button1_Click" />
        </Border>
        <Border BorderBrush="Silver" BorderThickness="1" Name="border2">
            <TextBox>
                <TextBox.Text>
                    <Binding Source="{StaticResource mObj}" Path="pText" UpdateSourceTrigger="PropertyChanged" Mode="TwoWay" />
                </TextBox.Text>
            </TextBox>    
        </Border>
    </DockPanel>
</Window>



C#
public class CMyData     : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        
        
        private string text="";

        public string pText
        {
            get { return text; }
            set 
            { 
                text = value;
                OnPropertyChanged("CHANGED");
            }
        }

       
        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
 
            if (handler != null) 
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }


    }

    public partial class MainWindow : Window
    {
        public CMyData mObj;
        
        
        public MainWindow()
        {
            InitializeComponent();
            mObj = new CMyData();
        }

        private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            mObj.pText = "Hello\r\nWorld";
           // UpdateLayout();
        }
    }

AnswerRe: unable to bind to TextBox.Text Pin
BobJanova16-Jan-12 23:21
BobJanova16-Jan-12 23:21 
GeneralRe: unable to bind to TextBox.Text Pin
Giorgi Nistor16-Jan-12 23:33
Giorgi Nistor16-Jan-12 23:33 
GeneralRe: unable to bind to TextBox.Text Pin
BobJanova17-Jan-12 1:47
BobJanova17-Jan-12 1:47 
GeneralRe: unable to bind to TextBox.Text Pin
Giorgi Nistor17-Jan-12 2:05
Giorgi Nistor17-Jan-12 2:05 
AnswerRe: unable to bind to TextBox.Text Pin
Pete O'Hanlon17-Jan-12 2:31
mvePete O'Hanlon17-Jan-12 2:31 
GeneralRe: unable to bind to TextBox.Text Pin
Giorgi Nistor17-Jan-12 4:17
Giorgi Nistor17-Jan-12 4:17 
GeneralRe: unable to bind to TextBox.Text Pin
Pete O'Hanlon17-Jan-12 4:31
mvePete O'Hanlon17-Jan-12 4:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.