BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
private void Button_Clicked(object sender, EventArgs e)
{
var items = dataGrid.GetRowGenerator().Items;
foreach (var item in items)
{
item.UpdateRow();
}
} |
I tried the method you suggested and it doesn't do anything visible. Maybe the UpdateRow method tries to update the data content on the row, but since the content isn't changed, no visible change is made when the method is called. The only things that should be updated is the styling, and I can't see that UpdateRow do that.
BUT...I have found a solution through a tip you gave in one of my other questions.
Since a row in my case is an array of the class UserData, all I had to do was to raise a PropertyChanged event for "UserData"
foreach (var item in data.Items)
{
item.RaisePropertyChanged("UserData");
}
dataGrid.GridStyle = new GridColors();
The last line is to trigger an update of GridStyle (I have a gridstyle class defining some of the colors.)
With those two additions, I can make the datagrid apply the new skin much faster than when i re-bound the ItemSource. Problem solved.