or
| private void pendingWorker_RunWorkerCompleted (object sender, RunWorkerCompletedEventArgs e) { |
| try { |
| this.gridView.Rows.Clear(); |
| this.gridView.MasterGridViewTemplate.GroupByExpressions.Clear(); |
| if (documentData != null && documentData.Rows.Count > 0) { |
| int rowCount = 0; |
| foreach (DataRow dr in documentData.Rows) { |
| ModelObject obj = GetModelObject(dr); |
| this.gridView.Rows.AddNew(); |
| PopulateRow(obj, rowCount); |
| rowCount++; |
| } |
| } |
| this.gridView.MasterGridViewTemplate.GroupByExpressions.Add("[StatusColumn] Group By [StatusColumn]"); |
| } catch (Exception ex) { |
| messageToolTip1.ShowExceptionMessage(ex); |
| logger.Error(ex); |
| } |
| CleanUpLoadingWorker(); |
| } |
| void OnGroupSumaryEvaluate (object sender, Telerik.WinControls.UI.GroupSummaryEvaluationEventArgs e) { |
| try { |
| if (e.FormatString.ToLower().Contains("status")) { |
| e.FormatString = "STATUS STANDING : {0}"; |
| this.gridView.MasterGridViewTemplate.ExpandAllGroups(); |
| } |
| } catch (Exception ex) { |
| messageToolTip1.ShowExceptionMessage(ex); |
| logger.Error(ex); |
| } |
| } |
| [debug_timing] = [0s 0m] AddinModule_AddinInitialize_Start |
| [0s 31m] AddinModule_AddinInitialize_End |
| [0s 0m] Display Form Request - Zeroed |
| [0s 0m] InitializeComponent start |
| [6s 515m] InitializeComponent end |
| [0s 62m] Form Loading |
| [0s 0m] Lookup Data Start |
| [0s 671m] Lookup Data End |
| [1s 718m] Display Form |
| private void InitializeComponent() |
| { this.SuspendLayout(); |
| <<<< a >>>>> |
| new Telerik.WinControls.UI....(); |
| .. |
| .. |
| ((System.ComponentModel.ISupportInitialize)....BeginInit(); |
| <<<< b >>>>>> |
| ... |
| setup properties for each forms object |
| .. |
| <<<<< c >>>>> |
| ((System.ComponentModel.ISupportInitialize)....EndInit(); |
| <<<<< d >>>>> |
| .. |
| .. |
| Moved all the ResumeLayout() and performLayout() calls here |
| } |
I have a problem with the SaveLayout / LoadLayout methods.
If I group my GridView by a DateTime column or a column which has been formatted and then save the layout, I get a null reference exception when I try to load it: "System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object."
At least it seems to be only when I do the mentioned grouping, but I won't say for sure that it won't happen in other cases as well. In my grid I mostly have Text columns, and the LoadLayout works fine if I group by these.
Is this a bug, or am I doing something wrong?
Regards, Jill-Connie Lorentsen