Link to home
Start Free TrialLog in
Avatar of rwright123
rwright123Flag for United States of America

asked on

Silverlight Datagrid Pass Selected Row to Child Window (for editing purposes)

I have a Silverlight 4 datagrid that is populated from a WCF web service.  What I would like to do is when a user clicks on a row a child window will pop open with the Rows contents being displayed.
I have the Child Window opening the only issue I am having is how to grab the selected row's data upon selection.  I know how to write event handler's to pass the data as well.  Just need to know how to access
the data itself.

Avatar of Gautham Janardhan
Gautham Janardhan

you can bind the selected item to an object and then use that object to retrieve the data. The object will be th eobject that is returnd from WCF service
As far as I understand you open the child window from some handler function which is called when user selects the row. So you know the data inside this function. If this is indeed the case, then probably the best approach is to set the DataContext property of your ChildWindow to the data when opening it. You can than bind the properties inside ChildWindow.xaml.
SOLUTION
Avatar of rwright123
rwright123
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial