Click here to Skip to main content
16,015,809 members
Home / Discussions / WPF
   

WPF

 
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 
GeneralRe: DataGrid CellTemplate / CellEditingTemplate Pin
eddieangel8-Apr-11 12:30
eddieangel8-Apr-11 12:30 
Binding StateId refers to the stateId of the datagrid's datacontext. Rather, it is a field on the property table, so it is one of the columns on SelectedItem<property>

So if this is all EF, as it is, then you have a Property Table and a PropertyState table with a FK - PK relationship. So if a property is in the state of CA, then the Property Table has stateId = 1, and PropertyState has Id:1|Name:California. Maybe I am too bound up in the WinForms world where the "Selected Value" of a combobox makes everything work automagically, but in this case my thought process was this:

{Binding PropertyState.name} simply gets the name of the state from the PropertyState table that belongs to whatever the stateID of the SelectedItem is. It obviously all works as it is, with the exception of a new item.

My thought on this was because the item does not yet have an item in the AllProperties collection, the UI is unable to resolve the relationship of Property (new) to PropertyState.

I could be way off base here. To maybe try a different tact, how would you deal with a datagrid in which you wanted to have a FK combo box column that constrains user choices, as in the scenario above? A simple address datagrid that has a drop down for State or Street Type or whatever?
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 
GeneralRe: Message: The name already exists in the tree: Pin
Vimalsoft(Pty) Ltd8-Apr-11 1:13
professionalVimalsoft(Pty) Ltd8-Apr-11 1:13 

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.