This is a migrated thread and some comments may be shown as answers.

RowDetailsTemplete Binding to another View

3 Answers 65 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 05 Jun 2011, 07:31 AM

Hi,

I am developing windows application by using MVVM pattern.

I have RowDetailsTemplete. In the templete, i have button.click event fired on this button.
Click event opens a new pop up, user selects a value from that pop-up.
Now I need to bind data came from pop-up to textbox present in RowDetailsTemplete.

Pleasev help me how we can pass the data from Another view to RowDetails Templete using MVVM pattern.

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 06 Jun 2011, 12:59 PM
Hello Rahul,

You may try to expose a property in your ViewModel, bind it to the Text property of the TextBox and update it on the Click event. It may be something similar to:

XAML:
<TextBox Text="{Binding MyText, Source={StaticResource MyViewModel}, Mode=TwoWay}"/>
C#:
var model = this.Resources["MyViewModel"] as MyViewModel;
model.MyText = "MyNewText";


Kind regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Rahul
Top achievements
Rank 1
answered on 10 Jun 2011, 10:51 PM
Hi Maya,

could you please refer below thread for exact issue..

I am using telerik datagrid..

Telerik datagrid have any solutions for this..

http://social.msdn.microsoft.com/Forums/en/wpf/thread/428a01d1-debf-4793-9dca-a289c85e2d97
0
Maya
Telerik team
answered on 16 Jun 2011, 07:57 AM
Hello Rahul,

Let me first clear the things out so that there are no misunderstandings. You have a grid with RowDetails defined. In each of those details you have a TextBox and a button, which Click event opens a PopUp. You want to select a value from it, update the value in the TextBox and update the selected item. Am I right or am I missing something ? 
If that is the case, you may bind both the SelectedItem of the RadGridView to a property in your view model and update it in that view model.
Please let me know if there are any misunderstandings or you need any further assistance.
 

Kind regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Rahul
Top achievements
Rank 1
Answers by
Maya
Telerik team
Rahul
Top achievements
Rank 1
Share this question
or