Hi guys,
I have a dialog that adds an item to the RadGridView in code behind. I immediately refresh the gvproperties items and search for the newly added item, but it is not present. I want to set the current and selected item to the new item, but indexof() fails. It returns null. Can you see what I might be doing wrong?
var addWell = new frmAddWellAssignment(_dataContext.SelectedUser.UserID.Trim(), false);
var assignmentAdded = addWell.ShowDialog();
if (assignmentAdded == true) {
_dataContext.LoadAssignments();
}
// RMH: Select the newly added item in the RadGridView
gvProperties.Items.Refresh();
var item = gvProperties.Items[gvProperties.Items.IndexOf(addWell.PropertyID)];
gvProperties.SelectedItem = item;
I have a dialog that adds an item to the RadGridView in code behind. I immediately refresh the gvproperties items and search for the newly added item, but it is not present. I want to set the current and selected item to the new item, but indexof() fails. It returns null. Can you see what I might be doing wrong?
var addWell = new frmAddWellAssignment(_dataContext.SelectedUser.UserID.Trim(), false);
var assignmentAdded = addWell.ShowDialog();
if (assignmentAdded == true) {
_dataContext.LoadAssignments();
}
// RMH: Select the newly added item in the RadGridView
gvProperties.Items.Refresh();
var item = gvProperties.Items[gvProperties.Items.IndexOf(addWell.PropertyID)];
gvProperties.SelectedItem = item;