This question is locked. New answers and comments are not allowed.
Whenever the content of my grid changes, it seems like I always have to reapply the group descriptors, which is fine, but in the following code snippet where the groups are reset, the GroupDescriptors.Clear() call returns a NullReferenceException probably around 1 out of every 5 times.
After the exception, the grid behaves weird until this code is run again. Any ideas as to why this is happening?
public void SetGroups(){ GroupDescriptor groups = new GroupDescriptor(); groups.Member = "AccountData.Name"; groups.SortDirection = ListSortDirection.Ascending; if (gvOrdersAlerts.GroupDescriptors != null && gvOrdersAlerts.GroupDescriptors.Count > 0) gvOrdersAlerts.GroupDescriptors.Clear(); gvOrdersAlerts.GroupDescriptors.Add(groups);}After the exception, the grid behaves weird until this code is run again. Any ideas as to why this is happening?