Click here to Skip to main content
15,912,457 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Pete O'Hanlon22-May-10 2:28
mvePete O'Hanlon22-May-10 2:28 
GeneralRe: How do you color a rectangle in C# that has been declared in XAML in WPF? Pin
Xarzu24-May-10 5:09
Xarzu24-May-10 5:09 
QuestionHow do you send a refresh message to a WPF grid or canvas? Pin
Xarzu21-May-10 16:10
Xarzu21-May-10 16:10 
AnswerRe: How do you send a refresh message to a WPF grid or canvas? Pin
Jürgen Röhr22-May-10 3:11
professionalJürgen Röhr22-May-10 3:11 
QuestionWPF TreeView - Get Reference To Image On Node Pin
Kevin Marois21-May-10 7:56
professionalKevin Marois21-May-10 7:56 
AnswerRe: WPF TreeView - Get Reference To Image On Node Pin
Pete O'Hanlon21-May-10 9:20
mvePete O'Hanlon21-May-10 9:20 
GeneralRe: WPF TreeView - Get Reference To Image On Node Pin
Kevin Marois21-May-10 10:20
professionalKevin Marois21-May-10 10:20 
QuestionTwo Way Data Binding In Wpf Pin
Manohar.K21-May-10 0:15
Manohar.K21-May-10 0:15 
Hi All,

I am currently facing problem with the usage of 2way binding in Wpf.

Here is my problem

I have 1 Model class and a view model class and a view to render data from view model.
I am using the ObjectDataProvider for databinding in View.
I have a method in view model which will give me the List of data (of type model).
Now I am showing this list in a ItemsControl in view with datatemplate applied.

Here is my ItemsControl:

<ItemsControl ItemsSource="{Binding Source={StaticResource ResourceKey=F1TeamsList}}" ItemTemplate="{StaticResource ResourceKey=F1TeamViewTemplate}"/>

I have 2 text box in datatemplate and I have specified twoway binding there.

<ObjectDataProvider x:Key="F1TeamsList" ObjectType="{x:Type f1teamvm:F1TeamViewModel}" MethodName="GetF1Teams"/>

<DataTemplate x:Key="F1TeamViewTemplate">
<StackPanel>
<TextBox x:Name="teamDriver1Box" Text="{Binding Path=TeamDriver1}"/>
<TextBox x:Name="teamDriver2Box" Text="{Binding Path=TeamDriver2}"/>
</StackPanel>
</DataTemplate>

Here F1TeamList - is the objectdataprovider which returns list and F1teamViewTemplate is datatemplate.
And GetF1Teams is the function which provides me list.
But this code is not working as expected. It fetches data properly but 2way binding is not working here

Any Idea??Confused | :confused:

Regards
Smile | :)
AnswerRe: Two Way Data Binding In Wpf Pin
Pete O'Hanlon21-May-10 0:55
mvePete O'Hanlon21-May-10 0:55 
GeneralRe: Two Way Data Binding In Wpf Pin
Manohar.K21-May-10 1:35
Manohar.K21-May-10 1:35 
GeneralRe: Two Way Data Binding In Wpf Pin
Pete O'Hanlon21-May-10 1:54
mvePete O'Hanlon21-May-10 1:54 
GeneralRe: Two Way Data Binding In Wpf Pin
Manohar.K21-May-10 2:23
Manohar.K21-May-10 2:23 
GeneralRe: Two Way Data Binding In Wpf Pin
Pete O'Hanlon21-May-10 3:09
mvePete O'Hanlon21-May-10 3:09 
GeneralRe: Two Way Data Binding In Wpf Pin
Manohar.K21-May-10 4:21
Manohar.K21-May-10 4:21 
QuestionWPF: Vista style window Pin
Prasoon Chaudhary19-May-10 19:19
Prasoon Chaudhary19-May-10 19:19 
AnswerRe: WPF: Vista style window Pin
Ray Cassick20-May-10 7:31
Ray Cassick20-May-10 7:31 
QuestionRetrieving template parts [I FEEL FRENCH] Pin
#realJSOP19-May-10 9:31
professional#realJSOP19-May-10 9:31 
AnswerRe: Retrieving template parts Pin
427748019-May-10 11:11
427748019-May-10 11:11 
GeneralRe: Retrieving template parts Pin
#realJSOP20-May-10 1:24
professional#realJSOP20-May-10 1:24 
QuestionMigration Tool from ASP.NET to Silverlight Pin
Shubhabrata Mohanty19-May-10 4:27
Shubhabrata Mohanty19-May-10 4:27 
AnswerRe: Migration Tool from ASP.NET to Silverlight Pin
R. Giskard Reventlov19-May-10 4:46
R. Giskard Reventlov19-May-10 4:46 
AnswerRe: Migration Tool from ASP.NET to Silverlight Pin
#realJSOP19-May-10 9:26
professional#realJSOP19-May-10 9:26 
AnswerRe: Migration Tool from ASP.NET to Silverlight Pin
Abhinav S19-May-10 19:02
Abhinav S19-May-10 19:02 
AnswerRe: Migration Tool from ASP.NET to Silverlight Pin
Kunal Chowdhury «IN»20-May-10 7:19
professionalKunal Chowdhury «IN»20-May-10 7:19 
Questioncustom control datagrid in WPF 3.5 framework Pin
kartheesh19-May-10 1:14
kartheesh19-May-10 1:14 

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.