Click here to Skip to main content
15,887,854 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF DataGrid cell click Pin
Erik Rude4-May-12 1:31
Erik Rude4-May-12 1:31 
GeneralRe: WPF DataGrid cell click Pin
LAPEC4-May-12 1:51
LAPEC4-May-12 1:51 
GeneralRe: WPF DataGrid cell click Pin
Erik Rude4-May-12 2:46
Erik Rude4-May-12 2:46 
AnswerRe: WPF DataGrid cell click Pin
Jeremy Hutchinson4-May-12 2:46
professionalJeremy Hutchinson4-May-12 2:46 
Questionuser control Pin
MemberDotNetting3-May-12 13:40
MemberDotNetting3-May-12 13:40 
AnswerRe: user control Pin
Jeremy Hutchinson4-May-12 2:34
professionalJeremy Hutchinson4-May-12 2:34 
AnswerRe: user control Pin
Alisaunder6-May-12 2:23
Alisaunder6-May-12 2:23 
QuestionHow to get the value of textbox in ViewModel in WPF - MVVM Pin
Rocky#3-May-12 4:02
Rocky#3-May-12 4:02 
Hi guys,

I'm working for the first time in WPF with MVVM pattern and I have a datagrid that is populated according to search terms in textbox on top. Right now, I'm able to populate the grid with all the data but I'm not able to get the value of the TextBox so I can filter it.

So here's a bit of the code:

In ViewModel:


C#
private string p_searchName;
public string _searchName
        {
            get
            {
                return p_searchName;
            }
            set
            {
                p_searchName = value;

                base.RaisePropertyChanged("_searchName");
            }
        }


In xaml file
<TextBox Height="23" HorizontalAlignment="Left"  Margin="2,45,0,0" Text="{Binding _searchName}" 
                         Name="tb_SearchName" VerticalAlignment="Top" Width="99" FontFamily="Lucida Console" TabIndex="10" 
                         Grid.Column="1" />


Any help is greatly appreciated!

Thanks
Rocky

My Blog

AnswerRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Jeremy Hutchinson3-May-12 5:30
professionalJeremy Hutchinson3-May-12 5:30 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Rocky#3-May-12 20:42
Rocky#3-May-12 20:42 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Jeremy Hutchinson4-May-12 1:48
professionalJeremy Hutchinson4-May-12 1:48 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Rocky#4-May-12 3:05
Rocky#4-May-12 3:05 
AnswerRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Mycroft Holmes3-May-12 12:46
professionalMycroft Holmes3-May-12 12:46 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Rocky#3-May-12 20:19
Rocky#3-May-12 20:19 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Pete O'Hanlon3-May-12 20:29
mvePete O'Hanlon3-May-12 20:29 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Rocky#3-May-12 20:43
Rocky#3-May-12 20:43 
AnswerRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Wayne Gaylard3-May-12 21:09
professionalWayne Gaylard3-May-12 21:09 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Rocky#4-May-12 3:04
Rocky#4-May-12 3:04 
GeneralRe: How to get the value of textbox in ViewModel in WPF - MVVM Pin
Wayne Gaylard4-May-12 20:22
professionalWayne Gaylard4-May-12 20:22 
QuestionHelp Understanding Dependancy Properties Pin
Kevin Marois2-May-12 7:10
professionalKevin Marois2-May-12 7:10 
AnswerRe: Help Understanding Dependancy Properties Pin
Abhinav S2-May-12 7:17
Abhinav S2-May-12 7:17 
GeneralRe: Help Understanding Dependancy Properties Pin
Kevin Marois2-May-12 7:38
professionalKevin Marois2-May-12 7:38 
AnswerRe: Help Understanding Dependancy Properties Pin
SledgeHammer012-May-12 7:24
SledgeHammer012-May-12 7:24 
GeneralRe: Help Understanding Dependancy Properties Pin
Kevin Marois2-May-12 7:37
professionalKevin Marois2-May-12 7:37 
QuestionMove picture Pin
Reginaldo Ap Primo2-May-12 3:30
Reginaldo Ap Primo2-May-12 3:30 

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.