Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Please tell me how can I remove the exception for clearing Rows of DataTable databinded.
posted

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.

Parents Reply Children
No Data