This question is locked. New answers and comments are not allowed.
Hi
We use Silverlight 4 in combination with RIA services. In our application we dynamically place the GridView instance to different ContentControls.
simplified Example:
UI
We use Silverlight 4 in combination with RIA services. In our application we dynamically place the GridView instance to different ContentControls.
simplified Example:
UI
<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions > <ContentControl Content="{Binding UserControlLeft}" ></ContentControl> <ContentControl Content="{Binding UserControlRight}" Grid.Column="1"><ContentControl> </Grid>
ViewModel
public class BaseStructureModel : ViewModelBase { public UserControl UserControlLeft {get;set;} // for the sake of simplicitly INotifiedPropertyChanged stuff left out public UserControl UserControlRight {get;set;} ...}
CODE to assign GridView to different controls
var gridViewInstance = UserControlLeft as GridView;
UserControlLeft = null;
UserControlRight = gridViewInstance; // column order changes the the user applied arre lost :-(
This works mostly but unfortunately, when the user changes the columns order, it will be lost when the gridview instance is applied to another content control. Furthermore, filter values entered by the user are also lost (or better will no longer work properly).
What can we do about it? Is there a possibility to ensure that settings the user applied (such as column order and filtering) are preserved whenn assigning the gridview control to another content control
Thanks for your help