Click here to Skip to main content
15,916,042 members
Home / Discussions / WPF
   

WPF

 
QuestionConvert to upper case on editing the cell data in WPF datagrid Pin
kartheesh6-Jun-10 23:01
kartheesh6-Jun-10 23:01 
AnswerRe: Convert to upper case on editing the cell data in WPF datagrid Pin
#realJSOP7-Jun-10 2:40
professional#realJSOP7-Jun-10 2:40 
GeneralRe: Convert to upper case on editing the cell data in WPF datagrid Pin
kartheesh7-Jun-10 3:14
kartheesh7-Jun-10 3:14 
AnswerRe: Convert to upper case on editing the cell data in WPF datagrid Pin
Pete O'Hanlon8-Jun-10 12:38
mvePete O'Hanlon8-Jun-10 12:38 
QuestionHow do you express file paths on the Website server from a Web service? [WORKAROUND] Pin
fjparisIII6-Jun-10 12:35
fjparisIII6-Jun-10 12:35 
AnswerRe: How do you express file paths on the Website server from a Web service? Pin
fjparisIII7-Jun-10 10:01
fjparisIII7-Jun-10 10:01 
QuestionWPF - Navigation w/o click sound Pin
crystal91545-Jun-10 13:56
crystal91545-Jun-10 13:56 
QuestionVisual Studio 2010 WPF and ListBoxes Pin
RossouwDB2-Jun-10 22:02
RossouwDB2-Jun-10 22:02 
Good day,

I wan't to ask something that is obvious to do in VS 2005 and VS 2008 (WPF), but for some reason, I am struggling my but of in VS 2010 (WPF). WTF | :WTF:

I want to dynamically load items into a ListBox, but for some reason it does not want to show up in the ListBox, they are there (I perform a count on the ListBox, and it shows the expected number).

Here is how I do it:

First of, I add an item like this: this.lstItems.Items.Add(OtherStackPanel(temp));, where OtherStackPanel is a function that returns a populated stackpanel, with the following items:
1 x Label, 1 x TextBox, 1 x ComboBox, 3 x Seperator, 1 x Slider, which look as follows

 __________________________________________________________________________
|          |           |       |           |         |           |        |
|ComboBox  | Seperator | Label | Seperator | TextBox | Seperator | Slider |
|__________|___________|_______|___________|_________|___________|________|


This would then be added to the ListBox, all the items in the StackPanel are set to be visible, and they have a parent since they are added to the StackPanel.

After I have added the StackPanel, I call the LayoutUpdated event of the ListBox, to make sure that they are contained in the ListBox, but I also add two addisional items from within this eventhandler, as follows:

private void listBox1_LayoutUpdated(object sender, EventArgs e)
{
  if (sender != null)
  {
     ListBoxItem l = new ListBoxItem();
     l.Content = "S";
     ListBoxItem n = new ListBoxItem();
     n.Content = "A";
     ((ListBox)sender).Items.Add(l);
     this.lstItems.Items.Add(n);
     MessageBox.Show(((ListBox)sender).Name);
     MessageBox.Show(Convert.ToString(((ListBox)sender).Items.Count));
  }
}


((ListBox)sender).Name returns ListBox, which is correct, since the item passed to this event is that listbox, and ((ListBox)sender).Items.Count returns 3, which is correct, since I have added the StackPanel, "S" and "A", but for some odd reason, I cannot see the items in the ListBox.

I have tried this.lstList.Items.Insert(0, "S"), but to no avail!

If you could provide a possible solution, I would really appreciate it (I don't know why it is so much different than VS 2008 WPF). Confused | :confused:

I am using Windows 7 Ulitmate.

Kind Regards,
Rossouw
Smile | :)
QuestionIs it possible to do a streaming upload to my server of audio recordings as they are being recorded by my Silverlight client-side application? Pin
Sandra McLeod2-Jun-10 8:39
Sandra McLeod2-Jun-10 8:39 
AnswerRe: Is it possible to do a streaming upload to my server of audio recordings as they are being recorded by my Silverlight client-side application? Pin
fred_8-Jun-10 10:17
fred_8-Jun-10 10:17 
QuestionPhotoshop like image editor with a drag and drop image gallery Pin
ikbegins1-Jun-10 23:37
ikbegins1-Jun-10 23:37 
AnswerRe: Photoshop like image editor with a drag and drop image gallery Pin
Abhinav S3-Jun-10 23:27
Abhinav S3-Jun-10 23:27 
AnswerRe: Photoshop like image editor with a drag and drop image gallery Pin
fjparisIII6-Jun-10 13:38
fjparisIII6-Jun-10 13:38 
GeneralRe: Photoshop like image editor with a drag and drop image gallery Pin
Mycroft Holmes6-Jun-10 15:02
professionalMycroft Holmes6-Jun-10 15:02 
GeneralRe: Photoshop like image editor with a drag and drop image gallery Pin
ikbegins7-Jun-10 21:50
ikbegins7-Jun-10 21:50 
GeneralRe: Photoshop like image editor with a drag and drop image gallery Pin
Mycroft Holmes7-Jun-10 22:19
professionalMycroft Holmes7-Jun-10 22:19 
GeneralRe: Photoshop like image editor with a drag and drop image gallery Pin
ikbegins9-Jun-10 21:37
ikbegins9-Jun-10 21:37 
QuestionSilverlight ---- Viewbox Control : How ? Pin
milestanley1-Jun-10 21:26
milestanley1-Jun-10 21:26 
AnswerRe: Silverlight ---- Viewbox Control : How ? Pin
Abhinav S1-Jun-10 21:47
Abhinav S1-Jun-10 21:47 
GeneralRe: Silverlight ---- Viewbox Control : How ? Pin
milestanley1-Jun-10 22:07
milestanley1-Jun-10 22:07 
AnswerRe: Silverlight ---- Viewbox Control : How ? Pin
Abhinav S1-Jun-10 23:11
Abhinav S1-Jun-10 23:11 
GeneralRe: Silverlight ---- Viewbox Control : How ? Pin
milestanley1-Jun-10 23:34
milestanley1-Jun-10 23:34 
AnswerRe: Silverlight ---- Viewbox Control : How ? Pin
Peace ON1-Jun-10 22:17
Peace ON1-Jun-10 22:17 
AnswerRe: Silverlight ---- Viewbox Control : How ? Pin
Mamta D3-Jul-10 20:51
Mamta D3-Jul-10 20:51 
QuestionHow do you vertically center an Expander within a ScrollViewer when it expands? [SOLVED] Pin
fjparisIII1-Jun-10 8:20
fjparisIII1-Jun-10 8:20 

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.