When both lists below on the line of code are populated my code works fine. However the error "Value cannot be null." occurs when LstNewItems is set to null. Why and how can i fix this or do i have to check if each list is null beforehand and act accordingly ?
this.radGridViewFiles.BeginInvoke((MethodInvoker)(
() => this.radGridViewFiles.DataSource = MyGlobals.ListOfItemsToControl
.Concat(MyGlobals.lstNewItems)
.ToList()
));
null
is virtually always preferable. – Pencilnull
lists is a slight code smell IMO, perhaps it should be fixed at that level. – Coax