Search code examples
datagridvisual-studio-lightswitchlightswitch-2012

Selected Item of Visuual Collection is not set in LightSwitch while changing the selection in Screen


I created a lightswitch control extension for Silverlight control that bounds to a collection. (like DataGrid)

It correctly shows data on a screen, but the underlying query's SelectedItem property is not getting updated when I select a row in the grid. When I use a LS DataGrid it works as expected.

What am guessing is, i need to bind the selected item of table and My Collection Control.

How can i do this in my extension itself??

Thanks..


Solution

  • Have you set the mode to two way?

    SelectedItem="{Binding Screen.CreatedProperty, Mode=TwoWay}
    

    this might help as well in you screen code:

     partial void ResponsibleRoles_SelectionChanged()
        {
            if (this.query.SelectedItem != null)
                Property = this.query.SelectedItem.field;
        }