Click here to Skip to main content
16,005,682 members
Home / Discussions / WPF
   

WPF

 
QuestionPass values between navigatioin or user control pages Pin
arkiboys31-Mar-11 4:46
arkiboys31-Mar-11 4:46 
AnswerRe: Pass values between navigatioin or user control pages Pin
Pete O'Hanlon31-Mar-11 5:02
mvePete O'Hanlon31-Mar-11 5:02 
GeneralRe: Pass values between navigatioin or user control pages [modified] Pin
arkiboys31-Mar-11 5:07
arkiboys31-Mar-11 5:07 
GeneralRe: Pass values between navigatioin or user control pages Pin
Pete O'Hanlon31-Mar-11 5:32
mvePete O'Hanlon31-Mar-11 5:32 
GeneralRe: Pass values between navigatioin or user control pages Pin
arkiboys31-Mar-11 5:36
arkiboys31-Mar-11 5:36 
GeneralRe: Pass values between navigatioin or user control pages Pin
Pete O'Hanlon31-Mar-11 5:50
mvePete O'Hanlon31-Mar-11 5:50 
GeneralRe: Pass values between navigatioin or user control pages Pin
arkiboys31-Mar-11 5:52
arkiboys31-Mar-11 5:52 
QuestionBind current listbox selection to string property in parent window [modified] Pin
Jean-Louis Leroy31-Mar-11 2:45
Jean-Louis Leroy31-Mar-11 2:45 
Hello,

I have a window with a listbox bound to a User table in a DataSet, which displays the userid column:

<Window Name="ParentWindow" ...>
....
<ListBox Name="listBoxUsers" ItemsSource="{Binding User}"
SelectionChanged="listBoxUsers_SelectionChanged"
SelectedItem="{Binding ElementName=ParentWindow,Path=CurrentUser,Mode=OneWayToSource}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=userid}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>

I managed to bind the current selection to a DataRowView property in the window:

public DataRowView CurrentUser
{
set
{
System.Diagnostics.Trace.WriteLine(value);
}
}

However, I'd like to bind to a string property:


public string CurrentUser
{
set; private get;
}

...so that I can read the currently selected userid easily via getCurrentUser().

Is that feasible ?

Thanks,
J-L


-- Modified Thursday, March 31, 2011 11:16 AM
AnswerRe: Bind current listbox selection to string property in parent window Pin
Mycroft Holmes31-Mar-11 12:58
professionalMycroft Holmes31-Mar-11 12:58 
Questionimage control not showing image at runtime. Pin
arkiboys30-Mar-11 23:30
arkiboys30-Mar-11 23:30 
AnswerRe: image control not showing image at runtime. Pin
Pete O'Hanlon31-Mar-11 0:05
mvePete O'Hanlon31-Mar-11 0:05 
GeneralRe: image control not showing image at runtime. Pin
arkiboys31-Mar-11 0:24
arkiboys31-Mar-11 0:24 
GeneralRe: image control not showing image at runtime. Pin
Pete O'Hanlon31-Mar-11 1:03
mvePete O'Hanlon31-Mar-11 1:03 
GeneralRe: image control not showing image at runtime. Pin
Mycroft Holmes31-Mar-11 1:07
professionalMycroft Holmes31-Mar-11 1:07 
GeneralRe: image control not showing image at runtime. [modified] Pin
arkiboys31-Mar-11 1:27
arkiboys31-Mar-11 1:27 
GeneralRe: image control not showing image at runtime. Pin
Pete O'Hanlon31-Mar-11 1:46
mvePete O'Hanlon31-Mar-11 1:46 
GeneralRe: image control not showing image at runtime. Pin
Mycroft Holmes31-Mar-11 2:12
professionalMycroft Holmes31-Mar-11 2:12 
GeneralRe: image control not showing image at runtime. Pin
Pete O'Hanlon31-Mar-11 2:19
mvePete O'Hanlon31-Mar-11 2:19 
Questionscrollbar [modified] Pin
arkiboys30-Mar-11 22:03
arkiboys30-Mar-11 22:03 
AnswerRe: scrollbar Pin
Pete O'Hanlon30-Mar-11 22:28
mvePete O'Hanlon30-Mar-11 22:28 
GeneralRe: scrollbar Pin
arkiboys30-Mar-11 22:48
arkiboys30-Mar-11 22:48 
GeneralRe: scrollbar Pin
Pete O'Hanlon30-Mar-11 23:04
mvePete O'Hanlon30-Mar-11 23:04 
QuestionNavigating to a specific Panorama item Pin
Paul Harsent30-Mar-11 12:24
Paul Harsent30-Mar-11 12:24 
QuestionTelerik RadRadioButton Hover Effect Pin
Kevin Marois30-Mar-11 11:29
professionalKevin Marois30-Mar-11 11:29 
AnswerRe: Telerik RadRadioButton Hover Effect Pin
SledgeHammer0130-Mar-11 11:42
SledgeHammer0130-Mar-11 11:42 

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.