Click here to Skip to main content
15,914,070 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Want to learn Silverlight from scratch in ASP.Net Pin
Amit Spadez11-Jul-10 22:13
professionalAmit Spadez11-Jul-10 22:13 
AnswerRe: Want to learn Silverlight from scratch in ASP.Net Pin
Abhinav S11-Jul-10 23:08
Abhinav S11-Jul-10 23:08 
AnswerRe: Want to learn Silverlight from scratch in ASP.Net Pin
Kunal Chowdhury «IN»12-Jul-10 17:23
professionalKunal Chowdhury «IN»12-Jul-10 17:23 
QuestionComboBox Items (Binding?) Pin
seblake11-Jul-10 13:31
seblake11-Jul-10 13:31 
AnswerRe: ComboBox Items (Binding?) Pin
Jammer11-Jul-10 22:43
Jammer11-Jul-10 22:43 
GeneralRe: ComboBox Items (Binding?) Pin
seblake13-Jul-10 16:58
seblake13-Jul-10 16:58 
GeneralRe: ComboBox Items (Binding?) Pin
Jammer14-Jul-10 1:36
Jammer14-Jul-10 1:36 
GeneralRe: ComboBox Items (Binding?) Pin
seblake14-Jul-10 8:03
seblake14-Jul-10 8:03 
So-o-o, modifying my initial post...

The data:
3, Text1, Nbr1
7, Text2, Nbr2
11, Text3, Nbr3
etc.

<ComboBox Name="myComboBox"
Content={Binding MyData}
<ComboBoxItem>3</ComboBoxItem>
<ComboBoxItem>7</ComboBoxItem>
<ComboBoxItem>11</ComboBoxItem>
<ComboBoxItem>13</ComboBoxItem>
</ComboBox>

<TextBox Name="txtOne"
Text="{Binding ElementName=myComboBox,
Path=SelectedItem.PropertyName}"</TextBox>

<TextBox Name="txtTwo"
Text="{Binding ElementName=myComboBox,
Path=SelectedItem.PropertyName}"</TextBox>

<TextBox Name='Etc-etc" />

When I only had one number to display, it was easy:


private void btnGenData_Click(object sender, RoutedEventArgs e)
{
txtNewText.Text = "Text1";
txtNewNbr.Text = "Nbr1";
}

Guess I'm now looking at a case statement...?

public ObservableCollection<string> MyData = new ObservableCollection<string>();

private void btnGenPrime_Click(object sender, RoutedEventArgs e)
{
switch (MyData)
{
case 3:
txtNewText.Text = "Text1";
txtNewNbr.Text = "Nbr1";
break;
case 7:
txtNewText.Text = "Text2";
txtNewNbr.Text = "Nbr2";
break;
case 11:
txtNewText.Text = "Text3";
txtNewNbr.Text = "Nbr3";
break;
}
}


I don't care if it's in XAML or codebehind...it is said you can almost do it all in XAML, right?

Sorry for being dense...

Thanks.

< Steve >
GeneralRe: ComboBox Items (Binding?) Pin
Jammer14-Jul-10 23:37
Jammer14-Jul-10 23:37 
QuestionToggleButton in datagrid Pin
Chris Hotchkiss11-Jul-10 6:28
Chris Hotchkiss11-Jul-10 6:28 
AnswerRe: ToggleButton in datagrid Pin
Jammer11-Jul-10 22:47
Jammer11-Jul-10 22:47 
AnswerRe: ToggleButton in datagrid Pin
sillvor12-Jul-10 11:56
sillvor12-Jul-10 11:56 
QuestionTab index not working properly with user controls Pin
dashingsidds10-Jul-10 2:37
dashingsidds10-Jul-10 2:37 
QuestionNo connection could be made because the target machine actively refused it Pin
Venkadeshbabu9-Jul-10 2:08
Venkadeshbabu9-Jul-10 2:08 
AnswerRe: No connection could be made because the target machine actively refused it Pin
Pete O'Hanlon9-Jul-10 2:34
mvePete O'Hanlon9-Jul-10 2:34 
AnswerRe: File Upload in Silver Light Pin
Abhinav S9-Jul-10 17:47
Abhinav S9-Jul-10 17:47 
QuestionWorking Out Which Controls are Within Points Pin
Jammer9-Jul-10 0:23
Jammer9-Jul-10 0:23 
AnswerRe: Working Out Which Controls are Within Points Pin
Pete O'Hanlon9-Jul-10 1:54
mvePete O'Hanlon9-Jul-10 1:54 
GeneralRe: Working Out Which Controls are Within Points Pin
Jammer9-Jul-10 2:39
Jammer9-Jul-10 2:39 
GeneralRe: Working Out Which Controls are Within Points Pin
Jammer9-Jul-10 3:37
Jammer9-Jul-10 3:37 
GeneralRe: Working Out Which Controls are Within Points Pin
Pete O'Hanlon9-Jul-10 3:50
mvePete O'Hanlon9-Jul-10 3:50 
QuestionWPF Navigation Frame Pin
Gretna7-Jul-10 22:55
Gretna7-Jul-10 22:55 
QuestionWPF : Print Page number on footer Pin
priyagee7-Jul-10 21:30
priyagee7-Jul-10 21:30 
QuestionSimple problem pre-select WPF Codeplex ComboBox item [modified] Pin
devvvy7-Jul-10 15:54
devvvy7-Jul-10 15:54 
Questionmultiple WCF client endpoints exposed as dropdown list Pin
Michael Eber7-Jul-10 13:00
Michael Eber7-Jul-10 13:00 

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.