This question is locked. New answers and comments are not allowed.
I am trying to update multiple rows of cells at once. Suppose the user selects 5 rows to be edited. The user updates the values only in the 1st row and then click on a button (Edit Selected Rows). The other selected rows should have the same value as the first row.
But the values are not visible on the UI after the button is selected. However, when I double click on any cell in the other selected rows, the updated values then appears. How to make it appear by click of the button so that I need not have to double click on every cell to check if the values are updated
private void radButton_Edit_Selected_Click(object sender, RoutedEventArgs e)
{
var x = grid_name.rdvRates.SelectedItems;
int counter = 1;
string score =string.Empty;
foreach (object y in x)
{
if (counter == 1)
{
score = SomeMethod.GetPropertyValue(y, "SCORE");
counter = counter + 1;
}
else
{
SomeMethod.SetPropertyValue(y, "SCORE", score);
}
}
}
public static void SomeMethod.SetPropertyValue(object obj, string name, object value)
{
Type type = obj.GetType();
if (type != null)
{
PropertyInfo prop = type.GetProperty(name);
if (prop != null)
{
prop.SetValue(obj, value, null);
}
}
}
But the values are not visible on the UI after the button is selected. However, when I double click on any cell in the other selected rows, the updated values then appears. How to make it appear by click of the button so that I need not have to double click on every cell to check if the values are updated
private void radButton_Edit_Selected_Click(object sender, RoutedEventArgs e)
{
var x = grid_name.rdvRates.SelectedItems;
int counter = 1;
string score =string.Empty;
foreach (object y in x)
{
if (counter == 1)
{
score = SomeMethod.GetPropertyValue(y, "SCORE");
counter = counter + 1;
}
else
{
SomeMethod.SetPropertyValue(y, "SCORE", score);
}
}
}
public static void SomeMethod.SetPropertyValue(object obj, string name, object value)
{
Type type = obj.GetType();
if (type != null)
{
PropertyInfo prop = type.GetProperty(name);
if (prop != null)
{
prop.SetValue(obj, value, null);
}
}
}