Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1320
Select data item in xamData grid
posted

Hi,

In our application we have a xamDataGrid bound to an EntityCollection. This collection is filled with data from the server and is retrieved entirely as updating row may result in several rows being changed. 

However we would like that the row being updated (and the one that might cause other rows being updated) remains selected after the entire collection is updated. 

I tried the following code but it doesn't seem to work:

private void AdressenDerdeView_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "Results")
{
var vm = ViewModel as AdressenDerdeViewModel;
if (dgContent.Records.Count > vm.IndexOfCurrentRow)
{
//dgContent.ActiveRecord = vm.Results.ElementAt(vm.IndexOfCurrentRow);
var rec = dgContent.Records[vm.IndexOfCurrentRow];
dgContent.ActiveRecord = rec;
// don't know if you really need this
dgContent.ActiveRecord.IsSelected = true;
}
//vm.CurrentRow = vm.Results.ElementAt(vm.IndexOfCurrentRow);
}
}

How can we do this?

Parents Reply Children
No Data