Hi, I'm using UltraCalendarInfo component and UltraTimelineView in the application. For reloading the data, the application has the following sequences. (I don't want to use ResetDataBindings for reloading, but ... ex.programmer made this style) 1.SuspendLayout for UltraTimelineView 2.ResetDataBindings of Owners and Appointments for UltraCalendarInfo 3.Clear all rows in the DataTable (DataBinded) and import rows from DataTable which load from RDBMS. (First Owner Table, Second Appointment Table) 4.SetDataBindings of Owners and Appointments for UltraCalendarInfo 5.ResumeLayout for UltraTimelineView Now, I have a little bit problem at the 3rd step, when I clear all rows in the Appointment Table. If I clear all rows like below, I don't have any problem.
for (int i = rowCount; i > 0; i--) { dt.Rows.Remove(dataRows[i - 1]); }
However, if I want to clear all rows like below, I have exceptions at the runtime.
dt.Rows.Clear();
The exceptions are followings: Exception thrown: 'System.ArgumentNullException' in mscorlib.dll Exception thrown: 'System.IndexOutOfRangeException' in Infragistics4.Shared.v17.2.dll Please give me information about the exceptions and tell me why it dousn't function properly when using the command clear, And in this case which command is apropriate to use, SuspendLayout/ResumeLayout or BeginUpdate/EndUpdate.
Any help would be much appreciated.
Hello Keiji,
I have been investigating into the behavior you are reporting where you are seeing a System.ArgumentNull and System.IndexOutOfRangeException using the steps that you have provided along with the sample code given at this documentation article. After abstracting much of the code in the documentation to their own methods so they can be called from a button click to repopulate the DataTable(s), I am unable to reproduce the behavior you are seeing. I do not receive any exception, but I also do not see anything in the timeline view after calling ResumeLayout, even though the tables are populated. This may be another issue entirely though, and so we will continue to focus on this one in the context of this thread.
With the above said, as I was unable to reproduce this behavior you are seeing, I am attaching the sample I used to test it here. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 17.2.20172.2076 of Infragistics for Windows Forms 2017.2.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if you have any other questions or concerns on this matter.
TimelineDataTableException.zip
Dear Andrew
Thank you for your information.I'm sorry, I had mistake that the DataTable has been binded not only the UltraCalendarInfowith UltraTimeView, but also UltraGrid control.And in this case, the exceptions occurs at UltraGrid_InitializeRow event, not at UltraTimeView control.When the method "e.Row.ChildBand[0].Rows.GetNonGroupedRows()" has been called, the exceptions has been occured.This exceptions have been handled and I could identified only through the Output window of Visual Studio.(The application runnning doesn't be halt)
It would be possible problem in the code of our application as you mentioned.But unfortunately, the usercontrol contains UltraGrid is not my part of job, and in this moment, I can't continuing the investigation of this problem, sorry.
On the other hand, please tell me which methods are apropriate, SuspendLayout(ResumeLayout) or BeginUpdate(EndUpdate) for improving the performance of Reset and Set Databinding.
Thanks
Thank you for your update on this matter. It sounds like perhaps you may need a check for the Count of your ChildBand index on the Row in this case. That may be what is causing the exception, although this is just speculation at the moment, as I have not yet reproduced the behavior.
Regarding the usage of Suspend/ResumeLayout and Begin/EndUpdate, I would recommend using both of these to generally improve the performance of reset and set databinding. The “Layout” related methods will prevent any actual layout logic as long as Suspend has been called without a corresponding Resume. The “Update” related methods are similar, in that they prevent painting of the control.
I hope this helps. Please let me know if you have any other questions or concerns on this matter.
Dear AndrewThank you so much.I'll apply your suggestion in the application.