Click here to Skip to main content
15,905,144 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF - PRism Framework Pin
Muhammed Nigil29-Jun-14 23:36
professionalMuhammed Nigil29-Jun-14 23:36 
AnswerRe: WPF - PRism Framework Pin
Pete O'Hanlon30-Jun-14 0:17
mvePete O'Hanlon30-Jun-14 0:17 
GeneralRe: WPF - PRism Framework Pin
Muhammed Nigil30-Jun-14 1:00
professionalMuhammed Nigil30-Jun-14 1:00 
GeneralRe: WPF - PRism Framework Pin
Pete O'Hanlon30-Jun-14 3:03
mvePete O'Hanlon30-Jun-14 3:03 
GeneralRe: WPF - PRism Framework Pin
Muhammed Nigil30-Jun-14 18:56
professionalMuhammed Nigil30-Jun-14 18:56 
GeneralRe: WPF - PRism Framework Pin
Muhammed Nigil30-Jun-14 19:26
professionalMuhammed Nigil30-Jun-14 19:26 
QuestionHow to display from nested usercontrol another usercontrol class on button click event? Pin
LAPEC29-Jun-14 7:12
LAPEC29-Jun-14 7:12 
QuestionHow to Display .aspx page in SilverlightWeb Application Pin
RavitejaPammi28-Jun-14 5:22
RavitejaPammi28-Jun-14 5:22 
Questionsilverlight Pin
Member 1087962427-Jun-14 19:40
Member 1087962427-Jun-14 19:40 
AnswerRe: silverlight Pin
Pete O'Hanlon29-Jun-14 6:51
mvePete O'Hanlon29-Jun-14 6:51 
GeneralRe: silverlight Pin
Jammer30-Jun-14 23:32
Jammer30-Jun-14 23:32 
GeneralRe: silverlight Pin
Pete O'Hanlon30-Jun-14 23:59
mvePete O'Hanlon30-Jun-14 23:59 
GeneralRe: silverlight Pin
thatraja30-Jun-14 23:52
professionalthatraja30-Jun-14 23:52 
GeneralRe: silverlight Pin
Pete O'Hanlon1-Jul-14 0:10
mvePete O'Hanlon1-Jul-14 0:10 
QuestionRepost from C# forum WPF app Pin
Wesley2026-Jun-14 23:26
Wesley2026-Jun-14 23:26 
AnswerRe: Repost from C# forum WPF app Pin
Mycroft Holmes29-Jun-14 4:55
professionalMycroft Holmes29-Jun-14 4:55 
QuestionWPF Combo Box SelectedValue = null issue Pin
Mhister Pamakwas25-Jun-14 11:54
Mhister Pamakwas25-Jun-14 11:54 
I got a combo box in wpf form I set the ItemSource to the collection of Dictionary of (Pet Type) and just display the Value and hid the Key

C#
public void BindComboBoxes()
        {
            this.cboTypes.ItemsSource = new    BindingSource(CommonMgr.GetPetTypesDropDown(false), null);
            this.cboTypes.DisplayMemberPath = "Value";
            this.cboTypes.SelectedValuePath = "Key";
        }

Then whenever I type to encode a new Breed Object, and type a text in the cboTypes of something that doesn't exist in its items(not in the db), my program will ask if the end user wants to add that new PetType in the db, if yes, then it will do so.

Then i update the cboTypes using the BindComboBoxes method again, set the cboTypes.Text into the new item and assign the Key to the designated field, but the problem is, it says, it was null. it worked fine in the windows form though. Here's my code:

C#
public Breed GetPageEntity()
        {
            Breed setEntity = new Breed();
            bool doesExist = false;
            setEntity.Id = DefaultValue.GetInt(this.txtId.Text);
            setEntity.BreedName = DefaultValue.GetString(this.txtName.Text);


            try
            {
                setEntity.PetTypeId = DefaultValue.GetInt(this.cboTypes.SelectedValue.ToString());
            }
            catch (Exception)
            {
                var addAnother = MessageBox.Show(String.Format("{0}: This type is not in the database. \nAdd {0} to the database?",
                    this.cboTypes.Text), "Pet Type Cannot Be Found", MessageBoxButtons.OKCancel);

                if (addAnother == System.Windows.Forms.DialogResult.OK)
                {
                    petTypeMgr.Entity = this.PetTypeAdder(cboTypes.Text);
                    string temp = this.cboTypes.Text;
                    petTypeMgr.Insert((petTypeMgr.Entity), fUser.Entity.Id, ref doesExist);
                    //cboTypes.ItemsSource = null;
                    //cboTypes.Items.Clear();
                    BindComboBoxes();
                    cboTypes.Text = temp;

//SelectedValue became null
                    setEntity.PetTypeId = DefaultValue.GetInt(this.cboTypes.SelectedValue);
                }

            }

            setEntity.Description = DefaultValue.GetString(this.txtDescription.Text);
            setEntity.SortOrder = DefaultValue.GetInt(txtSortOrder.Text);
            setEntity.StatusId = true;
            return setEntity;
        }

AnswerRe: WPF Combo Box SelectedValue = null issue Pin
Mycroft Holmes29-Jun-14 5:01
professionalMycroft Holmes29-Jun-14 5:01 
QuestionWPF RichTextBox Document Bind using Binding property Pin
moorthy00724-Jun-14 0:29
moorthy00724-Jun-14 0:29 
AnswerRe: WPF RichTextBox Document Bind using Binding property Pin
Richard Deeming24-Jun-14 0:43
mveRichard Deeming24-Jun-14 0:43 
QuestionDisplaying (Calling) 2 UserControl within a UserControl (WPF) Pin
LAPEC23-Jun-14 23:56
LAPEC23-Jun-14 23:56 
AnswerRe: Displaying (Calling) 2 UserControl within a UserControl (WPF) Pin
Matt T Heffron24-Jun-14 7:09
professionalMatt T Heffron24-Jun-14 7:09 
GeneralRe: Displaying (Calling) 2 UserControl within a UserControl (WPF) Pin
LAPEC24-Jun-14 7:32
LAPEC24-Jun-14 7:32 
QuestionAsync method using RenderTargetBitmap and BitmapEncoder Pin
FlurryKnox18-Jun-14 21:40
FlurryKnox18-Jun-14 21:40 
AnswerRe: Async method using RenderTargetBitmap and BitmapEncoder Pin
Gerry Schmitz19-Jun-14 13:39
mveGerry Schmitz19-Jun-14 13:39 

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.