Click here to Skip to main content
15,896,153 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
eddieangel8-Apr-11 9:47
eddieangel8-Apr-11 9:47 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
SledgeHammer018-Apr-11 10:18
SledgeHammer018-Apr-11 10:18 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
eddieangel8-Apr-11 10:29
eddieangel8-Apr-11 10:29 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
SledgeHammer018-Apr-11 10:52
SledgeHammer018-Apr-11 10:52 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
eddieangel8-Apr-11 11:43
eddieangel8-Apr-11 11:43 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
SledgeHammer018-Apr-11 12:03
SledgeHammer018-Apr-11 12:03 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
eddieangel8-Apr-11 12:07
eddieangel8-Apr-11 12:07 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
SledgeHammer018-Apr-11 12:18
SledgeHammer018-Apr-11 12:18 
It looks to me like the ComboBox is using this:

ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}},Path=DataContext.PropertyStates, ValidatesOnDataErrors=True,UpdateSourceTrigger=PropertyChanged}"

So ComboBox is showing PropertyStates, that looks like ObservableCollection<PropertyState> to me, so its a collection of PropertyState objects. Thus each item in the ComboBox is a PropertyState. ComboBox.SelectedValue is going to be a PropertyState as well.

Right now you are binding ComboBox.SelectedValue to: SelectedValue="{Binding stateId}" . You aren't showing what stateId is.

The TextBlock is binding to "{Binding PropertyState.name}" which has to be a property of some sort on your ViewModel. You aren't showing that either.

So your problem is that your combobox.SelectedValue is binding to something completely different from the TextBlock, they need to bind to the same property so when you go to edit, you'll have the right item selected and when you are done editing, the TextBlock will have the correct text.
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
eddieangel8-Apr-11 12:30
eddieangel8-Apr-11 12:30 
QuestionWhat Is A HitTest? Pin
Kevin Marois7-Apr-11 5:35
professionalKevin Marois7-Apr-11 5:35 
AnswerRe: What Is A HitTest? Pin
Pete O'Hanlon7-Apr-11 6:27
mvePete O'Hanlon7-Apr-11 6:27 
GeneralRe: What Is A HitTest? Pin
Kevin Marois7-Apr-11 6:32
professionalKevin Marois7-Apr-11 6:32 
GeneralRe: What Is A HitTest? Pin
Pete O'Hanlon7-Apr-11 6:38
mvePete O'Hanlon7-Apr-11 6:38 
GeneralRe: What Is A HitTest? Pin
Kevin Marois7-Apr-11 6:40
professionalKevin Marois7-Apr-11 6:40 
GeneralRe: What Is A HitTest? Pin
Pete O'Hanlon7-Apr-11 6:51
mvePete O'Hanlon7-Apr-11 6:51 
GeneralRe: What Is A HitTest? Pin
Kevin Marois7-Apr-11 6:52
professionalKevin Marois7-Apr-11 6:52 
GeneralRe: What Is A HitTest? Pin
Pete O'Hanlon7-Apr-11 8:29
mvePete O'Hanlon7-Apr-11 8:29 
GeneralRe: What Is A HitTest? Pin
Kevin Marois7-Apr-11 8:45
professionalKevin Marois7-Apr-11 8:45 
JokeRe: What Is A HitTest? Pin
Mycroft Holmes7-Apr-11 14:40
professionalMycroft Holmes7-Apr-11 14:40 
GeneralRe: What Is A HitTest? Pin
Pete O'Hanlon7-Apr-11 21:51
mvePete O'Hanlon7-Apr-11 21:51 
GeneralRe: What Is A HitTest? Pin
Mycroft Holmes7-Apr-11 22:14
professionalMycroft Holmes7-Apr-11 22:14 
QuestionMessage: The name already exists in the tree: Pin
Vimalsoft(Pty) Ltd6-Apr-11 23:42
professionalVimalsoft(Pty) Ltd6-Apr-11 23:42 
AnswerRe: Message: The name already exists in the tree: Pin
Abhinav S7-Apr-11 18:14
Abhinav S7-Apr-11 18:14 
GeneralRe: Message: The name already exists in the tree: [modified] Pin
Vimalsoft(Pty) Ltd7-Apr-11 18:48
professionalVimalsoft(Pty) Ltd7-Apr-11 18:48 
GeneralRe: Message: The name already exists in the tree: Pin
Pete O'Hanlon7-Apr-11 22:15
mvePete O'Hanlon7-Apr-11 22:15 

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.