Click here to Skip to main content
15,303,572 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Problems updating datagrid from collection Pin
Mycroft Holmes23-Jan-14 12:04
professionalMycroft Holmes23-Jan-14 12:04 
QuestionBinding property from XML file data Pin
abollmeyer21-Jan-14 9:18
Memberabollmeyer21-Jan-14 9:18 
AnswerRe: Binding property from XML file data Pin
abollmeyer21-Jan-14 14:44
Memberabollmeyer21-Jan-14 14:44 
QuestionCombobox / Textblock field Pin
eddieangel21-Jan-14 6:24
Membereddieangel21-Jan-14 6:24 
AnswerRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 7:52
professionalJason Gleim21-Jan-14 7:52 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 8:07
Membereddieangel21-Jan-14 8:07 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 8:48
professionalJason Gleim21-Jan-14 8:48 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 9:14
Membereddieangel21-Jan-14 9:14 
Thank you, I failed to implement the INPC at the model level, so none of the screen elements were updating as intended. I am still not getting the dropdown to update correctly, though. How should I implement that combobox?

I tried binding the Combobox directly to the Category like this:

HTML
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}},Path=DataContext.Categories}" DisplayMemberPath="Category" SelectedValuePath="Id" SelectedItem="{Binding Category}" Style="{StaticResource GridEditStyle}" />


But when I do that the textblock updates correctly but there is no item selected initially when I click on the field to edit it.

Here are the important model pieces:

C#
private SCategory category;
        public SCategory Category 
        {
            get { return category; }
            set
            {
                if (category == value)
                    return;
                category = value;
                OnPropertyChanged("Category");
            }
        }


And then the SCategory:

C#
public class SCategory : Base
    {
        private int id;
        public int Id
        {
            get
            {
                return id;
            }
            set
            {
                if (value == id)
                    return;
                id = value;
                OnPropertyChanged("Id");
                OnPropertyChanged("Category");
            }
        }

        
        private string category;
        public string Category
        {
            get
            {
                return category;
            }
            set
            {
                if (string.IsNullOrEmpty(value) || value == category)
                    return;
                category = value;
                OnPropertyChanged("Category");
            }
        }
    }


If I bind the combobox using SelectedValuePath and SelectedValue I am not getting the right field in the textblock, but I am getting the correct field in the combobox.

Cheers, --EA
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 9:42
professionalJason Gleim21-Jan-14 9:42 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 10:12
Membereddieangel21-Jan-14 10:12 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim21-Jan-14 10:25
professionalJason Gleim21-Jan-14 10:25 
GeneralRe: Combobox / Textblock field Pin
eddieangel21-Jan-14 11:29
Membereddieangel21-Jan-14 11:29 
GeneralRe: Combobox / Textblock field Pin
Jason Gleim22-Jan-14 4:28
professionalJason Gleim22-Jan-14 4:28 
GeneralRe: Combobox / Textblock field Pin
eddieangel22-Jan-14 5:34
Membereddieangel22-Jan-14 5:34 
QuestionHow to stop repeating animation Pin
Member 1001614016-Jan-14 12:25
MemberMember 1001614016-Jan-14 12:25 
AnswerRe: How to stop repeating animation Pin
Varsha Ramnani20-Jan-14 22:41
professionalVarsha Ramnani20-Jan-14 22:41 
QuestionWPF Checkbox Binding Question Pin
Kevin Marois10-Jan-14 8:38
professionalKevin Marois10-Jan-14 8:38 
AnswerRe: WPF Checkbox Binding Question Pin
Meshack Musundi12-Jan-14 8:28
professionalMeshack Musundi12-Jan-14 8:28 
AnswerRe: WPF Checkbox Binding Question Pin
eddieangel21-Jan-14 7:53
Membereddieangel21-Jan-14 7:53 
QuestionVS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 4:47
MemberAnthony.Canossi9-Jan-14 4:47 
AnswerRe: VS2013: cannot locate resource Pin
Mycroft Holmes9-Jan-14 11:49
professionalMycroft Holmes9-Jan-14 11:49 
GeneralRe: VS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 21:25
MemberAnthony.Canossi9-Jan-14 21:25 
GeneralRe: VS2013: cannot locate resource Pin
Mycroft Holmes9-Jan-14 21:37
professionalMycroft Holmes9-Jan-14 21:37 
GeneralRe: VS2013: cannot locate resource Pin
Anthony.Canossi9-Jan-14 22:28
MemberAnthony.Canossi9-Jan-14 22:28 
AnswerRe: VS2013: cannot locate resource Pin
Meshack Musundi12-Jan-14 7:53
professionalMeshack Musundi12-Jan-14 7:53 

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.